Image Processing Apparatus, Image Processing Method, and Program

ABSTRACT

An image processing apparatus includes a face detector detecting face images from still-image frames successively extracted from a moving-image stream in accordance with image information items regarding the still-image frames, a face-feature-value calculation unit calculating face feature values of the face images in accordance with image information items regarding the face images, an identity determination unit determining whether a first face image in a current frame and a second face image in a previous frame represent an identical person in accordance with at least face feature values of the first and second face images, and a merging processor which stores one of the first and second face images when the first face image and the second face image represent an identical person, and which stores the first and second face images when the first face image and the second face image do not represent an identical person.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to image processing apparatuses, imageprocessing methods, and programs. More particularly, the presentinvention relates to an image processing apparatus which extractscharacters through the following analysis performed within a shortperiod of time. The image processing apparatus detects face images(images of a predetermined object) included in still-image framessuccessively obtained from a moving-image stream, determines whether aperson corresponding to a face image detected in a current frame is thesame as a person corresponding to a face image which is detected in aprevious frame and which has been stored, in accordance with facefeature values of the two face images, and stores one of the two faceimages when the determination is affirmative.

2. Description of the Related Art

In recent years, opportunities of capturing moving images have beenincreased since camcorders and digital still cameras which employ harddisks and memory cards as recording media have been widely used. Variousmethods, such as a method for detecting highlights using moving imageanalysis, have been proposed in order to quickly retrieve and viewdesired moving-image files and scenes from many moving-image files whichhave been recorded. An example of such a method for improving ease ofretrieval and ease of viewing of moving images includes a method forextracting characters in a moving-image file employing a face detectiontechnique and a face identifying technique. Other similar methods havebeen proposed.

Japanese Unexamined Patent Application Publication No. 2008-77536, forexample, discloses a method for performing face tracking on adjacentframes in a still-image sequence obtained by decoding a moving-imagefile so that face areas of identical persons are determined, and finallyperforming clustering in order to distinguish characters.

SUMMARY OF THE INVENTION

In the method disclosed in Japanese Unexamined Patent ApplicationPublication No. 2008-77536, a full frame of the moving-image file or analmost full frame of the moving-image file should be input so that theface tracking is accurately performed. This method is suitable for acase where the face tracking is performed during shooting. However, whena moving-image file is to be processed after shooting, the moving-imagefile should be fully decoded. When full decoding is performed on amoving-image file for a high-definition television which has been usedin recent years, considerably long analysis time is necessary.Therefore, the method disclosed in Japanese Unexamined PatentApplication Publication No. 2008-77536 is not practical.

It is desirable to effectively extract characters within a short periodof time for analysis.

According to an embodiment of the present invention, there is providedan image processing apparatus including a face detector configured todetect face images from still-image frames successively extracted from amoving-image stream in accordance with image information items regardingthe still-image frames, a face-feature-value calculation unit configuredto calculate face feature values of the face images in accordance withimage information items regarding the face images detected by the facedetector, an identity determination unit configured to determine whethera first face image which is included in a current frame and which isdetected by the face detector and a second face image which is includedin a previous frame and which has been detected and stored by the facedetector represent an identical person in accordance with at least facefeature values of the first and second face images calculated by theface-feature-value calculation unit, and a merging processor configuredto store only one of the first and second face images when the identitydetermination unit determined that the first face image and the secondface image represent an identical person, and to store both the firstand second face images when the identity determination unit determinedthat the first face image and the second face image do not represent anidentical person.

In this embodiment, the face detector detects the face images includedin the still-image frames successively extracted from the moving-imagestream by the face detector in accordance with the image informationitems regarding the still-image frames. Note that, although the faceimages are detected in this embodiment, images of a certain object maybe generally detected.

For example, the moving-image stream includes intraframes atpredetermined intervals. The image information items regarding thestill-image frames are successively extracted from the moving-imagestream by performing data decompression processing on image informationitems of the intraframes.

The face-feature-value calculation unit calculates the face featurevalues of the face images detected by the face detector. Theface-feature-value calculation unit detects face-feature positions, suchas positions of both ends of an eyebrow, both ends of an eye, the centerof the eyebrow, and the center of the eye, and calculates face featurevalues (local-feature-value vectors) in the face-feature positions usinga convolution operation such as Gabor Filter.

An identical person appears in the moving-image stream. Therefore, aplurality of face images representing an identical person are includedin the face images detected in accordance with the image informationitems regarding the still-image frames successively extracted from themoving-image stream. When a character included in the moving-imagestream is to be extracted, only a single face image is finallydetermined for the character.

The identity determination unit determines whether the first face imagedetected in the current frame and the second face image detected in theprevious frame which has been stored represent an identical person inaccordance with at least the face feature values of the first and secondface images calculated by the face-feature-value calculation unit. Theidentity determination unit may obtain a degree of similarity betweenthe first and second face images in accordance with the face featurevalues of the first and second face images, and may compare the degreeof similarity with a threshold value so as to determine whether thefirst and the second face images represent an identical person.

The identity determination unit may determine whether the first andsecond face images represent an identical person in accordance with, inaddition to the face feature values of the first and second face images,at least detection-frame information items regarding the first andsecond face images or information on an interval between frames of thefirst and second face images.

The identity determination unit may obtain a degree of similaritybetween the first and second face images in accordance with the facefeature values of the first and second face images, determine that thefirst and second face images represent an identical person when thedegree of similarity is equal to or larger than a first threshold value,and determine that the first and second face images represent anidentical person when the detection-frame information items regardingthe first and second face images and the information on an intervalbetween frames of the first and second face images satisfy predeterminedconditions and when the degree of similarity is smaller than the firstthreshold value and equal to or larger than a second threshold value.

The predetermined condition for the detection-frame information itemsmay include a first condition in which a distance between a center of adetection frame of the first face image and a center of a detectionframe of the second face image is smaller than a threshold value, and asecond condition in which an ratio of an area of the detection frame ofthe first face image to an area of the detection frame of the secondface image is in a range from a first threshold value to a secondthreshold value. The predetermined condition for the information on aframe interval may correspond to a condition in which an intervalbetween frames of the first and second face images are smaller than athreshold value.

When the identity determination unit determined that the first andsecond images represent an identical person, the merging processorstores one of the first and second face images. When the identitydetermination unit determined that the first and second images do notrepresent an identical person, the merging processor stores both thefirst and second face images.

In this embodiment, the face images included in the still-image framessuccessively extracted from the moving-image stream are detected, and adetermination as to whether the face image detected in the current frameand the face image detected in the previous frame represent an identicalperson is made in accordance with the face feature values of the faceimages. When the determination is affirmative, only one of the faceimages is stored.

In this case, the still-image frames from which the face images aredetected are extracted every one second, for example. Therefore, sincethe number of frames to be analyzed is small, characters are extractedwith a short analysis time. For example, a MPEG stream or an AVC streamis employed, merely intraframes included this stream in predeterminedintervals are decoded to be used. That is, a so-called full decoding isnot necessarily, and therefore, reduction of the analysis time isattained.

As described above, since the identity determination unit determineswhether the first face image and the second face image represent anidentical person in accordance with at least the detection-frameinformation items regarding the first and second face images or theinterval between the frames of the first and second face images,determination accuracy is enhanced.

In a case where the degree of similarity between the first and secondface images which is calculated in accordance with the face featurevalues of the first and second face images is low due to a lightingcondition even though the first face image and the second face imagerepresent an identical person, it is determined that the first faceimage and the second face image represent an identical person takingwhether the detection-frame information items regarding the first andsecond face images and information on the interval between the frames ofthe first and second face images satisfy predetermined conditions intoconsideration.

The image processing apparatus may further includes aface-rotation-angle detector configured to detect face-rotation anglesrepresenting angles of faces represented by the face images detected bythe face detector, and a noise-face removing unit configured to remove,from among all the face images detected by the face detector, faceimages having face-rotation angles in a predetermined direction relativeto the front which are larger than a threshold value, in accordance withinformation items regarding the face-rotation angles detected by theface-rotation-angle detector.

As for images representing a face which faces considerably sideways, aface which faces considerably upward, and a face which facesconsiderably downward, it is possible that face feature values are notaccurately obtained by the face-feature-value calculation unit, andaccordingly, the determination accuracy of the identity determinationunit may be degraded. As described above, by removing the face imageshaving face-rotation-angles in a predetermined direction relative to thefrom which are larger than the threshold value, images representing aface which faces considerably sideways, a face which faces considerablyupward, and a face which faces considerably downward are removed inadvance. Accordingly, the determination accuracy of the identitydetermination unit is prevented from being degraded.

The image processing apparatus may further include a contrast scorecalculation unit configured to calculate contrast scores representingcontrast of the face images in accordance with the image informationitems regarding the face images detected by the face detector, and anoise-face removing unit configured to remove face images havingcontrast scores, which have been calculated by the contrast scorecalculation unit, smaller than a threshold value from among all the faceimages detected by the face detector.

It is highly possible that face feature values of blurred face imageshaving considerably low contrast scores are not accurately calculatedresulting in deterioration of the determination accuracy of the identitydetermination unit. As described above, by removing the face imageshaving the contrast scores smaller than a threshold value, the blurredface images having considerably low contrast scores are removed inadvance. Accordingly, the determination accuracy of the identitydetermination unit is prevented from being degraded.

The image processing apparatus may include a face clustering unitconfigured to assign the face images stored by the merging processor toclusters at least in accordance with the face feature values calculatedby the face-feature-value calculation unit so that face imagesrepresenting an identical person are assigned to a single cluster.

When the end of the moving-image stream is reached, the mergingprocessor stores a predetermined number of face images in accordancewith image data items corresponding to the still-image framessuccessively extracted from the moving-image stream. The face clusteringunit performs clustering processing in accordance with at least thefeature values calculated by the feature value calculation unit so that,among the face images stored by the merging unit, face imagesrepresenting an identical person are assigned to a single cluster.

As described above, when the merging processor determined that the faceimage of the current frame and the face image in the previous framewhich has been stored represent an identical person, one of the faceimages is stored. In this way, when the end of the moving-image streamis reached, the number of face images ultimately stored in the mergingprocessor is reduced. Therefore, reduction of processing time of theface clustering unit is reduced.

The face clustering unit may include a similarity degree calculationunit, a layering/clustering unit, and a cluster determination unit. Thesimilarity degree calculation unit may calculate degrees of similarityof individual pairs of face images extracted from the face images storedby the merging processor in accordance with the face feature values ofthe corresponding pairs of face images. The layering-and-clustering unitmay assign the face images stored by the merging processor to individualclusters, and successively merge clusters including each of the pairs offace images in accordance with the degrees of similarity of the pairs offace images calculated by the similarity degree calculation unit in adescending order of the degrees of similarity of the pairs of faceimages.

The cluster determination unit may determine whether over-mergingoccurred on the clusters starting from a cluster at an uppermost layerin accordance with cluster information items arranged in a tree-shapedstructure obtained by the layering/clustering unit, and determineclusters by dividing each of clusters which have been determined to beover-merged clusters into two clusters which were obtained beforemerging processing is performed by the layering/clustering unit.

The cluster determination unit may include an average-face-feature-valuecalculation unit configured to calculate an average face feature value,which is obtained by averaging the face feature values of the faceimages included in a cluster subjected to the over-merging determinationprocessing, and an individual-similarity-degree calculation unitconfigured to calculate an individual-similarity-degree in accordancewith the average face feature value calculated by theaverage-face-feature-value calculation unit and a face feature value ofone of the face images included in the cluster subjected to theover-merging determination processing. When theindividual-similarity-degree for at least one of the face imagesincluded in the cluster subjected to the over-merging determinationprocessing is smaller than a threshold value for a comparison with aindividual-similarity-degree, it is determined that the clustersubjected to the over-merging determination processing is an over-mergedcluster. A user setting unit may allow a user to set the threshold valuefor a comparison with an individual-similarity-degree.

The cluster determination unit may further include anaverage-similarity-degree calculation unit configured to calculate anaverage similarity degree by averaging individual-similarity-degrees forthe face images included in the cluster subjected to the over-mergingdetermination processing, the individual-similarity-degrees beingobtained by the individual-similarity-degree calculation unit. When theaverage similarity degree calculated by the average-similarity-degreecalculation unit is smaller than a threshold value for a comparison withan average similarity degree, it is determined that the clustersubjected to the over-merging determination processing is an over-mergedcluster. A user setting unit may allow a user to set the threshold valuefor a comparison with an average similarity degree.

The image processing apparatus may further includes arepresentative-image determination unit configured to determine, foreach of clusters including a plurality of face images, a representativeface image from among the plurality of face images included in each ofthe clusters. The representative-image determination unit determines,for each of the clusters including the plurality of face images, therepresentative face image from among the plurality of face imagesincluded in each of the clusters in accordance with at leastface-rotation-angle information items, facial-expression informationitems, or contrast information items regarding the plurality of faceimages.

For each of the clusters including the plurality of face images, therepresentative-image determination unit may reduce the number of theface images in accordance with the face-rotation-angle information itemsso as to obtain a first face-image group including face images havingface-rotation angles smaller than a first threshold value. Then, therepresentative-image determination unit may reduce the number of theface images included in the first face-image group in accordance withthe facial expression information items so as to obtain a secondface-image group including face images having scores representingdegrees of a specific facial expression larger than a second thresholdvalue. The representative-image determination unit may determine, fromamong the face images included in the second face-image group, a faceimage having the highest score representing a degree of contrast to bethe representative face image in accordance with the contrastinformation items. A user setting unit may allow a user to set the firstand second threshold values.

As described above, since the clustering processing in which, among theface images stored by the merging processor, face images of an identicalperson are assigned to a single cluster, and a representative face imageis determined for the cluster including the face images. Therefore, in abrowser application which displays the face images of the characters inthe moving-image stream, overlap of face images of an identical personis prevented, and furthermore, optimum face images are displayed.

Accordingly, face images (images of a certain object) included instill-image frames successively extracted from a moving-image stream aredetected, and it is determined whether a face image detected in acurrent frame and a face image which is detected in a previous frame andwhich has been stored represent an identical person in accordance withface feature values of the face images. When the determination isaffirmative, one of the face images is stored. Accordingly, extractionof the characters is effectively performed with a short analysis time.

Accordingly, the similarity degree calculation, the layering/clusteringprocessing, and the cluster determination are successively performed inthis order, and clustering in which, among a plurality of face images(images of a specific object), face images representing an identicalperson are assigned to a single cluster is effectively performed.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram illustrating a configuration example of animage processing apparatus according to an embodiment of the presentinvention; and

FIG. 2 is a plan view illustrating location information and sizeinformation of a face detection frame which are included inface-detection-frame information;

FIGS. 3A and 3B are diagrams illustrating a yaw angle, a roll angle, apitch angle, which serve as face-rotation angles;

FIG. 4 is a diagram illustrating a configuration of data (face data)corresponding to each face image;

FIG. 5 is a diagram illustrating a configuration of cluster data servingas character data;

FIG. 6 is a diagram schematically illustrating a processing procedure ofan image processing apparatus;

FIG. 7 is a diagram illustrating data decompression processing anddecoding performed on image information in an intra frame (I frame)which appears in a predetermined cycle when a moving-image streamcorresponds to a MPEG video stream;

FIG. 8 is a flowchart illustrating a processing procedure of the imageprocessing apparatus;

FIG. 9 is a diagram illustrating face-image detection processingperformed by a face detection unit;

FIG. 10 is a diagram illustrating a detection frame FR-fa set in astill-image frame (still-image) for detecting a face image;

FIG. 11 is a diagram illustrating a face dictionary used when face-imagedetection is performed and measurement of a face score SCORE_fa usingthe face dictionary;

FIG. 12 is a diagram illustrating the relationship between positioninformation and the detection frame FR-fa for each pair;

FIG. 13 is a diagram illustrating a still-image frame (still image) IM-0and images IM-0 a and IM-0 b obtained by reducing the size of thestill-image frame IM-0;

FIG. 14 is a flowchart illustrating a procedure of the face-imagedetection processing performed by the face detection unit;

FIG. 15 is a diagram illustrating face-feature positions detected when aface-feature-value calculation unit calculated face feature values(local face-feature-value vectors);

FIG. 16 is a diagram illustrating normalization processing performed ona face image IM-1 when a smile score is calculated by theface-feature-value calculation unit;

FIG. 17 is a diagram illustrating a smile dictionary and measurement ofa smile score SCORE_sm using the smile dictionary;

FIG. 18 is a flowchart illustrating a procedure of processing ofmeasuring the smile score SCORE_sm using the smile dictionary;

FIG. 19 is a diagram illustrating a method for obtaining a contrastscore ContrastScore by adding a square value of a difference ofluminance values of adjacent pixels obtained for individual pixels;

FIG. 20 is a flowchart illustrating a method for obtaining the contrastscore ContrastScore of a certain face image IM-2;

FIG. 21 is a flowchart illustrating a procedure of operations performedby the face detection unit and the face-feature-value calculation unitevery time a still-image frame (still image) is extracted from amoving-image stream by a decoding unit;

FIG. 22 is a flowchart illustrating a procedure of processing ofremoving noise-face images performed by a noise-face removing unit;

FIGS. 23A and 23B are diagrams illustrating an example of a face imagewhich is not an image of a side face and in which a yaw angle thereof is−5 degrees, and an example of a face image which is an image of a sideface (noise face) and in which the yaw angle thereof is +50 degrees;

FIGS. 24A and 24B are diagrams illustrating an example of a face imagewhich is not a blurred face image and in which a contrast score thereofis 350, and an example of a face image which is a blurred face image(noise face image) and in which a contrast score thereof is 120;

FIG. 25 is a flowchart illustrating a procedure of identical-facemerging processing performed by an identical-face-combining processor;

FIGS. 26A and 26B are diagrams illustrating an example of a previousface image and an example of a current face image which are highlysimilar to each other, and therefore, determined to be images of anidentical person;

FIGS. 27A and 27B are diagrams illustrating an example of a previousface image and an example of a current face image which are barelysimilar to each other, and therefore, not determined to be images of anidentical person only from a degree of the similarity;

FIGS. 28A and 28B are diagrams illustrating an example of a previousface image and an example of a current face image which are barelysimilar to each other, but is determined to be images of an identicalperson only if conditions of a face detection frame and a period of timebetween frames are satisfied;

FIG. 29 is a flowchart illustrating a procedure of face clusteringprocessing performed by the face clustering unit;

FIG. 30 is a diagram illustrating calculations of degrees ofsimilarities performed for individual pairs of two face images by theface clustering unit using a similarity matrix;

FIG. 31 is a table illustrating an example of a face-pair list generatedby sorting the face pairs in an order of a degree of similarity inaccordance with results of the calculations using the similarity matrix;

FIG. 32 is a flowchart illustrating a procedure of the calculationsusing the similarity matrix and processing of generating the face-pairlist performed by the face clustering unit;

FIG. 33 is a diagram illustrating a configuration of data (node data) ofeach node included in a layered structure;

FIG. 34 is a diagram illustrating an example of the layered structure ofnodes generated through layered clustering processing;

FIG. 35 is a diagram illustrating a concrete example of the node data;

FIG. 36 is a flowchart illustrating a procedure of the layeredclustering processing performed by the face clustering unit;

FIG. 37 is a diagram illustrating processing of sequentially stackingnodes from the uppermost nodes so that it is determined whetherover-merging occurred in cluster determination processing performed bythe face clustering unit;

FIG. 38 is a flowchart illustrating a procedure of the clusterdetermination processing performed by the face clustering unit;

FIG. 39 is a flowchart illustrating a procedure of cluster over-mergingdetermination processing performed by the face clustering unit;

FIG. 40 is a diagram illustrating a calculation of anaverage-local-feature-value vector (average feature value);

FIG. 41 is a diagram illustrating an example of determination ofclusters in cluster determination processing;

FIG. 42 is a flowchart illustrating a procedure of representative-facedetermination processing performed by the face clustering unit;

FIGS. 43A to 43D are diagrams illustrating processing of determiningthat a face image which is a front-face image and which has uniformluminance is a representative face image, for example, from among a faceimage which is not a front-face image, a face image which is afront-face image and which has uniform luminance, a face image which isa front-face image and which has poor luminance, and a face image whichis a blurred face image;

FIG. 44 is a diagram illustrating an example of a general resultobtained when the face clustering processing is performed on a pluralityof face images of persons “Mr. A” to “Mr. K”;

FIG. 45 is a confusion table representing the relationships betweenpredicting results and actual results;

FIG. 46 is a confusion table when ideal face clustering processing isperformed;

FIG. 47 is a first diagram illustrating the relationships betweenresults of clustering (classification) and entropies (averageinformation values);

FIG. 48 is a second diagram illustrating the relationships betweenresults of clustering (classification) and entropies (averageinformation values);

FIG. 49 is a third diagram illustrating the relationships betweenresults of clustering (classification) and entropies (averageinformation values); and

FIG. 50 is a diagram illustrating an example of an inner configurationof a computer which executes processing operations of functional unitsof the image processing apparatus.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

Embodiments of the present invention will be described hereinafter withreference to the accompanying drawings.

Description of Entire Apparatus

FIG. 1 is a block diagram illustrating a configuration example of animage processing apparatus 100 according to an embodiment of the presentinvention. The image processing apparatus 100 includes a decoding unit101, a face detection unit 102, a face-feature-value calculation unit103, a noise-face removing unit 104, an identical-faces-mergingprocessor 105, and a face clustering unit 106.

The decoding unit 101 reads a moving-image file recorded in a hard disk(HDD) or a memory card, for example, and extracts still-image framesapproximately every one second from a moving-image stream included inthe moving-image file. In a case where the moving-image streamcorresponds to video streams of MPEG (Moving Picture Expert Group) orAVCHD (Advanced Video Coded High Definition), the decoding unit 101performs data decompression processing on image information items ofintraframes which appear in a predetermined cycle so as to output imageinformation items of desired still-image frames.

The face detection unit 102 detects face images included in thestill-image frames in accordance with the image information items of thestill-image frames (still images) successively extracted by the decodingunit 101. The face detection unit 102 detects the face images byscanning each of the still-image frames while face detection frames areslid with a plurality of resolutions, for example. However, a method fordetecting the face images by the face detection unit 102 is not limitedto this. The face detection unit 102 will be described in detailhereinafter.

Every time the face detection unit 102 detects the face images, the facedetection unit 102 assigns unique identifiers used to specify the faceimages to the detected face images as face IDs. Each of the face IDs isgenerated using a frame number of a corresponding one of the framesincluded in the moving-image stream and a number representing an orderof detection in the corresponding one of the frames.

The face detection unit 102 adds the face IDs to the detected individualface images, and supplies face-image information items (imageinformation items in the face detection frames) and face-detection-frameinformation items to the face-feature-value calculation unit 103. Here,each of the face-detection-frame information items includes locationinformation and size information. The location information represents,for example, as shown in FIG. 2, a location (x, y) of a pixel at anupper left corner of a detection frame DF in a still-image frame. Thesize information represents, for example, as shown in FIG. 2, ahorizontal size “width” and a vertical size “height” of the detectionframe DF in the still-image frame. The sizes are represented by thenumber of pixels.

Note that, in this embodiment, when detecting the face images from thestill-image frames (still images), the face detection unit 102 detectsface-rotation angles representing angles of faces of the face images.Therefore, the face detection unit 102 functions as aface-rotation-angle detection unit. The face detection unit 102 detectsthe face images, for example, using a face dictionary which learns inaccordance with a machine learning algorithm such as AdaBoost. Since theface detection unit 102 includes the face dictionary for the pluralityof face-rotation angles, the face detection unit 102 detectsface-rotation angles along with the face images. However, the detectionmethod is not limited to this. Alternatively, a method for detectingparts of a face in each of the face images, such as eyes, a nose, and amouth so that the face-rotation angles are detected in accordance withthe distances relationship among the parts or the location relationshipamong the parts may be employed.

Directions of the face-rotating angles include three angles, i.e., a yawangle, a roll angle, and a pitch angle. As shown in FIG. 3A, the yawangle is defined with an axis 202 as the center. The axis 202 isperpendicular to an axis 201 which is parallel to a line connectingright and left eyes of a person and which extends substantially throughthe center of the head of the person. A right-hand direction of the yawangle denotes a negative direction, and a left-hand direction of the yawangle denotes a positive direction. Furthermore, as shown in FIG. 3B,the roll angle is generated by rotation with an axis 203 as the center.The axis 203 is perpendicular to the axis 201 and the axis 202, and anangle which makes the axis 201 horizontal is determined to be 0 degree.Moreover, as shown in FIG. 3A, the pitch angle is defined with the axis201 as the center, and is made on an upper side or a lower side of theaxis 201. A direction in which the face which turns up corresponds to apositive direction whereas a direction in which the face which turnsdown corresponds to a negative direction.

The face detection unit 102 adds the face IDs to the detected face IDsand supplies face-rotation-angle information items (yaw, roll, andpitch) to the face-feature-value calculation unit 103 along with theface-image information items and the face-detection-frame informationitems (x, y, width, and height).

The face-feature-value calculation unit 103 calculates face featurevalues of the face images in accordance with the image information itemsof the face images detected by the face detection unit 102, that is, theinformation items of the face detection frames of the face images. Theface-feature-value calculation unit 103 detects face-feature positions,such as positions of both ends of an eyebrow, both ends of an eye, thecenter of the eyebrow, and the center of the eye, and calculateslocal-feature-value vectors (identification feature vectors) in theface-feature positions using a convolution operation such as Gaborfilter. However, a method for calculating the local-feature-valuevectors is not limited to this. The face-feature-value calculation unit103 will be described in detail hereinafter.

Note that, in this embodiment, the face-feature-value calculation unit103 calculates, in addition to the face-feature values of the faceimages, scores representing degrees of a certain facial expression, suchas smile scores representing degrees of smile, and contrast scoresrepresenting degrees of contrast. Therefore, the face-feature-valuecalculation unit 103 corresponds to in a smile-score calculation unitand a contrast-score calculation unit.

The face-feature-value calculation unit 103 calculates the smile scoresusing a smile dictionary which leans in accordance with a machinelearning algorithm such as AdaBoost. However, a method for calculatingthe smile scores is not limited to this. Furthermore, theface-feature-value calculation unit 103 calculates the contrast scoresby adding square values of differences between luminance values ofadjacent pixels, which are obtained for individual pixels, to oneanother. However, a method for calculating the contrast scores is notlimited to this. The method for calculating the smile scores and themethod for calculating the contrast scores will be described in detailhereinafter.

The face-feature-value calculation unit 103 supplies the face featurevalues, the smile scores, and the contrast scores to the noise-faceremoving unit 104 along with the face-detection-frame information itemsand the face-rotation-angle information items which were supplied fromthe face detection unit 102.

The noise-face removing unit 104 removes face images including images ofside faces or blurred face images which may adversely affect toprocessing of the identical-faces-merging processor 105 and processingof the face clustering unit 106 in a succeeding stage. In particular,when amateurs capture moving images, blurring of images often occur, aperson who is an object of an image often moves, or an image of a sideface of a person is often captured.

Here, it is highly possible that the face-feature-value calculation unit103-does not obtain accurate face feature values of the blurred faceimages. Therefore, it is highly possible that this adversely affects toaccuracies of the processing of the identical-faces-merging processor105 and the processing of the face clustering unit 106. Accordingly, thenoise-face removing unit 104 performs threshold-value processing on thecontrast scores obtained as described above by the face-feature-valuecalculation unit 103 so as not to supply the blurred face images to theprocessing operations in the succeeding stage.

Similarly, it is highly possible that the face-feature-value calculationunit 103 does not obtain accurate face feature values of the side-faceimages. Therefore, it is highly possible that this adversely affects toaccuracies of the processing of the identical-faces-merging processor105 and the processing of the face clustering unit 106. Accordingly, thenoise-face removing unit 104 performs threshold-value processing on theface-rotation angles obtained as described above by the face detectionunit 102 so as not to supply the side-face images to the processingoperations in the succeeding stage.

The noise-face removing unit 104 removes face images having contrastscores smaller than a threshold value (150, for example). Furthermore,the noise-face removing unit 104 removes face images havingface-rotation angles in a predetermined direction relative to the front,that is, in a direction of the yaw angle or a direction of the pitchangle which are larger than a threshold value (45 degrees, for example).The noise-face removing unit 104 will be described in detail.

The noise-face removing unit 104 supplies, among data items (hereinafterreferred to as “face data items”) corresponding to the face imagessupplied from the face-feature-value calculation unit 103, face dataitems other than face data items corresponding to removed face images tothe identical-faces-merging processor 105.

Here, configurations of the face data items will be described. FIG. 4 isa diagram illustrating a configuration of each of the face data items.The face data item includes a face ID, face-detection-frame information,face-rotation-angle information, a smile score, a contrast score, and aface feature value. As described above, the face ID is assigned by theface detection unit 102, and the face-detection-frame information andthe face-rotation-angle information are obtained by the face detectionunit 102. Furthermore, as described above, the face feature value, thesmile score, and the contrast score are obtained by theface-feature-value calculation unit 103.

The identical-faces-merging processor 105 performs processing of mergingidentical face images every time the face data items included in acurrent frame is supplied from the noise-face removing unit 104.Therefore, the identical-faces-merging processor 105 corresponds to anidentity-determination unit and a merging processor.

Since the identical-faces-merging processor 105 performs the mergingprocessing on identical face images, the number of face imagesultimately stored by the time the end of the moving-image stream isreached is reduced. Accordingly, a period of time in which processing ofclassifying characters is performed by the face clustering unit 106 inthe succeeding stage is reduced. In a long moving-image stream in whicha single person is continued to be shot, for example, if theidentical-faces-combining processing is not performed, it is possiblethat the processing of the face clustering unit 106 in the succeedingstage fails since face images of the person are detected in hundreds ofor thousands of frames.

Furthermore, since the identical-faces-merging processor 105 performsthe merging processing on the face images representing the identicalperson, the number of face images ultimately stored by the time the endof the moving-image stream is reached is reduced. Accordingly, accuracyof processing of classifying the characters performed by the faceclustering unit 106 in the succeeding stage is improved. In general,when face images of an identical person are collectively stored, thesmaller the number of face images to be supplied to the face clusteringunit 106 is, the higher accuracy of the processing of classifyingcharacters is. As the number of face images of an identical person to besupplied to the face clustering unit 106 increases, over-dividing inwhich face images representing an identical person are classified intodifferent clusters is likely to occur.

The identical-faces-merging processor 105 determines whether a person ina first face image (current face image) which is detected in a currentframe and a person in a second face image (previous face image) whichwas detected in a previous frame and which has been stored are anidentical person. In this case, for this determination, theidentical-faces-merging processor 105 sets individual threshold valuesfor a degree of similarity calculated in accordance with face featurevalues of the two face images, positions of face-detection frames in thetwo face images, sizes of the face-detection frames, and an interval(frame interval) between frames of the two face images.

If the frame interval is small, the positions of the face-detectionframes are similar to each other, and the sizes of the face-detectionframes are similar to each other, for example, it is highly possiblethat the persons in the two face images correspond to an identicalperson. Therefore, the identical-faces-merging processor 105 determinesthat the persons in the two face images are an identical person even ifthe degree of similarity of the two face images is low due to a lightingcondition, for example. Conversely, if the frame interval is large andthe degree of similarity of the two face images is low, theidentical-faces-merging processor 105 determines that the persons in thetwo face images are different from each other. When theidentical-faces-merging processor 105 determines that the persons in thetwo face images correspond to an identical person, only one of the twoface images is stored whereas when the identical-faces-merging processor105 determines that the persons in the two face images are not anidentical person, both the two face images are stored. Theidentical-faces-merging processor 105 will be described in detailhereinafter.

When the end of the moving-image stream is reached, theidentical-faces-merging processor 105 supplies face data items (refer toFIG. 4) corresponding to face images which have been ultimately storedto the face clustering unit 106.

When the end of the moving-image stream is reached, the face clusteringunit 106 performs clustering processing on the face images ultimatelystored in the identical-faces-merging processor 105 so that face imagesrepresenting an identical person are assigned to a single cluster. Inthis way, characters in the moving-image stream are classified. The faceclustering unit 106 performs the clustering processing at least inaccordance with the face feature values of the face images.

In a browsing application which displays a list of the characters in themoving-image stream, face images representing an identical person shouldbe represented by a single face image for simplicity. Therefore, theface clustering unit 106 determines a representative face image fromamong the plurality of face images included in a cluster obtained as aresult of the clustering processing. The face clustering unit 106determines the representative face image from among the plurality offace images in accordance with, for example, at least one of theface-rotation-angle information items, facial expression informationitems, and the contrast information items. The face clustering unit 106will be described in detail hereinafter.

The face clustering unit 106 outputs data items of clusters serving ascharacter data items representing the characters in the moving-imagestream. FIG. 5 is a diagram illustrating a configuration of each of thecluster data items serving as the character data items. The cluster dataitem includes a cluster ID, a face ID list, and a representative faceID. The cluster ID is an identifier used to identify a clustercorresponding to the cluster data item. The face ID list includes faceIDs assigned to the face images included in the cluster corresponding tothe cluster data item. The representative face ID is used to identifythe representative face image determined as described above when theplurality of face images are included in the cluster.

Operation of the image processing apparatus 100 shown in FIG. 1 will nowbe described.

The decoding unit 101 reads a moving-image file recorded in a hard disk(HDD) or a memory card, for example, and extracts still-image framesapproximately every one second from a moving-image stream in themoving-image file. In a case where the moving-image stream correspondsto a video stream of MPEG (Moving Picture Expert Group) as shown in (A)of FIG. 6 and (A) of FIG. 7, for example, the decoding unit 101 performsdata decompression processing so as to decode image information items ofintraframes (I frames) which appear in a predetermined cycle so as tosuccessively output image information items of still-image frames asshown in (A) of FIG. 6 and (B) of FIG. 7.

The image information items of the still-image frames (still images)successively extracted from the moving-image stream by the decoding unit101 are supplied to the face detection unit 102. As shown in (C) of FIG.6, the face detection unit 102 detects face images included in thestill-image frames. Every time the face detection unit 102 detects theface images, the face detection unit 102 assigns unique IDs(identifiers) used to specify the face images to the detected faceimages as face IDs. Furthermore, the face detection unit 102 detectsface-rotation angles representing angles of faces in the detected faceimages. The face detection unit 102 adds the face IDs to the detectedindividual face images, and supplies face-image information items,face-detection-frame information items (x, y, width, and height), andface-rotation angle information items (yaw, roll, and pitch) to theface-feature-value calculation unit 103.

The face-feature-value calculation unit 103 calculates local featurevalue vectors (identification feature vectors) serving as face featurevalues of the face images as shown in (C) of FIG. 6 in accordance withthe image information items of the face images detected by the facedetection unit 102. Furthermore, the face-feature-value calculation unit103 calculates smile scores representing degrees of smile and contrastscores representing degrees of contrast on the basis of the imageinformation items of the face images detected by the face detection unit102. The face-feature-value calculation unit 103 supplies the facefeature values, the smile scores, and the contrast scores to thenoise-face removing unit 104 along with the face-detection-frameinformation items and the face-rotation-angle information items whichwere supplied from the face detection unit 102.

The noise-face removing unit 104 removes face images including images ofside faces or blurred face images which may adversely affect toprocessing of the identical-faces-merging processor 105 and processingof the face clustering unit 106 in a succeeding stage. Accordingly, thenoise-face removing unit 104 performs the threshold-value processing asdescribed above on the contrast scores obtained by theface-feature-value calculation unit 103 so as to remove the blurred faceimages. Furthermore, the noise-face removing unit 104 performs thethreshold-value processing as described above on the face-rotationangles obtained by the face detection unit 102 so as to remove theside-face images. That is, the noise-face removing unit 104 removesnoise face images (blurred face images and side-face images). Thenoise-face removing unit 104 supplies, among face data itemscorresponding to the face images obtained by the face detection unit102, face data items (including the face IDs, the face-detection-frameinformation items, the face-rotation-angle information items, the smilescore, the contrast score, and the face feature values) other than facedata items corresponding to noise face images to theidentical-faces-merging processor 105.

The identical-faces-merging processor 105 performs processing of mergingidentical face images every time the face data items included in acurrent frame is supplied from the noise-face removing unit 104. In thiscase, the identical-faces-merging processor 105 sets individualthreshold values to a degree of similarity calculated in accordance withface feature values of the two face images, positions of face-detectionframes in the two face images, sizes of the face-detection frames, andan interval (frame interval) between frames of the two face images for adetermination as to whether persons in two face images represent anidentical person. When the identical-faces-merging processor 105determines that the persons in the two face images represent anidentical person, only one of the two face images is stored whereas whenthe identical-faces-merging processor 105 determines that the persons inthe two face images are not an identical person, both the two faceimages are stored.

By the processing of the noise-face removing unit 104 and the processingof the identical-faces-merging processor 105 on the face images detectedfrom the still-image frames by the face detection unit 102, when the endof the moving-image stream is reached, the identical-faces-mergingprocessor 105 stores face images except for the noise face images, andface images of an identical person are merged as shown in (D) of FIG. 6.

When the end of the moving-image stream is reached, theidentical-faces-merging processor 105 supplies face data itemscorresponding to the face images which have been ultimately stored inthe identical-faces-merging processor 105 to the face clustering unit106. The face clustering unit 106 performs clustering processing(classifying processing) so that face images of an identical person areassigned to a single cluster. The face clustering unit 106 determines arepresentative face image from among the plurality of face imagesincluded in the cluster obtained as a result of the clusteringprocessing.

Since the face clustering unit 106 performs the clustering processingand the representative-image determination processing as describedabove, the face clustering unit 106 outputs character data items (dataitems of clusters) representing the characters in the moving-imagestream with less overlaps of character data items representing anidentical person.

FIG. 8 is a flowchart illustrating a processing procedure of the imageprocessing apparatus 100 of FIG. 1.

In step ST1, the image processing apparatus 100 starts processing, andproceeds to step ST2. In step ST2, the decoding unit 101 of the imageprocessing apparatus 100 decodes an intraframe (I frame) of a movingimage stream included in a moving-image file so as to extract imageinformation of a still-image frame (still image).

In step ST3, the face detection unit 102 of the image processingapparatus 100 attempts to detect face images in the still-image frame,and the process proceeds to step ST4. Note that, in step ST3, the imageprocessing apparatus 100 also detects face-rotation angles of the faceimages along with the face images.

In step ST4, the image processing apparatus 100 determines whether anyface image is detected. When the determination is negative in step ST4,the image processing apparatus 100 returns to step ST2, and the decodingunit 101 performs decoding processing on the next intraframe (I frame).On the other hand, when the determination is affirmative in step ST4,the image processing apparatus 100 proceeds to step ST5.

In step ST5, the face-feature-value calculation unit 103 of the imageprocessing apparatus 100 calculates local-feature-value vectors as facefeature values of the face images detected in step ST3. Note that, instep ST5, the face-feature-value calculation unit 103 of the imageprocessing apparatus 100 also calculates smile scores and contrastscores of the face images detected in step ST3.

In step ST6, the image processing apparatus 100 determines whether anoise face image (a side-face image or a blurred face image) is includedin the face images detected in step ST3 in accordance with theface-rotation angles detected in step ST3 and the contrast scorescalculated in step ST5. When the determination is affirmative in stepST6, the image processing apparatus 100 removes, in step ST7, the noiseface image from among the face images detected in step ST3, and proceedsto step ST8. On the other hand, when the determination is negative instep ST6, the image processing apparatus 100 directly proceeds to stepST8.

In step ST8, the identical-faces-merging processor 105 of the imageprocessing apparatus 100 determines whether each of the face imagesdetected in the current frame is identical to any one of face imageswhich have been detected in a previous frame and which have been storedin the identical-faces-merging processor 105 on the basis of degrees ofsimilarity calculated in accordance with face feature values of the twoface images, positions of detection frames in the two face images,sizes, and an interval between frames of two face images to be comparedwith each other.

In step ST9, the image processing apparatus 100 successively sets eachof the face images detected in the current frame as an object of thedetermination, and determines whether a person in each of the faceimages detected in the current frame is identical to any person in theface images detected in the previous frame in accordance with results ofthe determinations in step ST8. When the determination is affirmative instep ST9, the identical-faces-merging processor 105 of the imageprocessing apparatus 100 performs processing of merging face imagesrepresenting an identical person, that is, processing of storing onlyone of the face images representing an identical person in step ST10.Thereafter, the image processing apparatus 100 proceeds to step ST11. Onthe other hand, when the determination is negative in step ST10, theface image which is an object of the determination is stored.Thereafter, the image processing apparatus 100 proceeds to step ST11.

In step ST11, the image processing apparatus 100 determines whether theend of the moving-image stream is reached. When the determination isnegative in step ST11, the image processing apparatus 100 returns tostep ST2, and the decoding unit 101 performs the decoding processing onthe next intraframe (I frame). On the other hand, when the determinationis affirmative in step ST11, the image processing apparatus 100 proceedsto step ST12.

In step ST12, the face clustering unit 106 of the image processingapparatus 100 performs face clustering processing. That is, the imageprocessing apparatus 100 performs the clustering processing (classifyingprocessing) so that the face images representing an identical person areassigned to a single cluster. In addition, for a cluster including aplurality of face images, the image processing apparatus 100 performsprocessing of determining a representative face image from among theplurality of face images included in the cluster so as to generatecharacter data. After step ST12, the processing of the image processingapparatus 100 is terminated in step ST13.

The face detection unit 102, the face-feature-value calculation unit103, the noise-face removing unit 104, the identical-faces-mergingprocessor 105, and the face clustering unit 106 which are included inthe image processing apparatus 100 shown in FIG. 1 will be described indetail hereinafter.

Face Detection Unit

The face detection unit 102 detects face images included in still-imageframes in accordance with image information items (image informationitems obtained after grayscale conversion is performed) of thestill-image frames (still images) which have been successively extractedby the decoding unit 101 and which have been temporarily stored in astorage device (not shown). Furthermore, the face detection unit 102detects face-rotation angles representing angles of faces correspondingto the face images when detecting the face images from the still-imageframes (still images).

For example, when a still-image frame IM-0 shown in (A) of FIG. 9 isdetected, the face detection unit 102 detects a face image IM-1, whichis denoted by a frame of a dashed line in (B) of FIG. 9, included in thestill-image frame IM-0. After the face image IM-1 is detected, the facedetection unit 102 normalizes the face image IM-1 so that a face imageIM-2 having a predetermined size, that is, a horizontal size of 80pixels and a vertical size of 80 pixels in this embodiment, is obtainedas shown in (C) of FIG. 9 to be processed by the face-feature-valuecalculation unit 103.

The face detection unit 102 adds face IDs to the detected face images,and instructs the storage device to store face image information items(information items regarding the face images in a face detection framewhich have been normalized), face-detection-frame information items(location information items and size information items), andface-rotation-angle information items. Then, the face detection unit 102supplies the stored information items to the face-feature-valuecalculation unit 103 in a succeeding stage at an appropriate timing.

An example of the processing of detecting the face images performed bythe face detection unit 102 will be described. In this detectionprocessing, as shown in FIG. 10, a detection frame FR-fa having apredetermined size, that is, a horizontal size of S pixels and avertical size of S pixels is set in the still-image frame IM-0. In thisexample, the S pixels correspond to 80 pixels or more. As shown byarrows in FIG. 10, the detection frame FR-fa moves over the still-imageframe IM-0 so that a position of the detection frame FR-fa issuccessively changed. Then, measurement of a face score SCORE_fa isperformed on an image defined by the detection frame FR-fa using a facedictionary. In accordance with the face score SCORE_fa, it is determinedwhether the image defined by the detection frame FR-fa is a face image.

The face dictionary includes t4 combinations (several hundredscombinations) of pix_fa1(i), pix_fa2(i), θ_fa(i), and α_fa(i) as shownin (B) of FIG. 11. Here, pix_fa1(i) and pix_fa2(i) denote, as shown inFIG. 12, positions of two points in the image defined by the detectionframe FR-fa. Note that, in FIG. 12, only three pairs of pix_fa1(i) andpix_fa2(i) are shown for simplicity. Furthermore, θ_fa(i) denotes athreshold value of a difference between a luminance value of pix_fa1(i)and a luminance value of pix_fa2(i). Moreover, α_fa(i) denotes weight tobe added or reduced in accordance with a result of comparison betweenthe difference between the luminance value of pix_fa1(i) and theluminance value of pix_fa2(i) and the threshold value θ_fa(i). Detaileddescriptions of the values of pix_fa1(i), pix_fa2(i), θ_fa(i), andα_fa(i) are omitted, and these values are obtained by being learned bythe machine learning algorithm such as AdaBoost.

As shown in (A) of FIG. 11, the measurement of the face score SCORE_fais performed as follows. It is determined whether each of thecombinations of pix_fa1(i), pix_fa2(i), θ_fa(i), and α_fa(i) satisfiesExpression (1). When the determination is affirmative, Expression (2) isperformed. On the other hand, when the determination is negative,Expression (3) is performed. Note that, in Expression (1), pix_fa1(i)denotes a luminance value of its position, and pix_fa2(i) denotes aluminance value of its position.

pix_(—) fa1(i)−pix_(—) fa2(i)<θ_(—) fa(i)   (1)

SCORE_(—) fa=SCORE_(—) fa+α _(—) fa(i)   (2)

SCORE_(—) fa=SCORE_(—) fa−α _(—) fa(i)   (3)

The determination as to whether the image defined by the detection frameFR-fa is a face image is made in accordance with the face score SCORE_fameasured as described above. Note that, in the measurement of the facescore SCORE_fa described above, it is assumed that h(i) is 1 whenExpression (1) is satisfied and h(i) is −1 when Expression (1) is notsatisfied, the measured face score SCORE_fa is expressed by Expression(4).

$\begin{matrix}{{SCORE\_ fa} = {\sum\limits_{i}{{h(i)}{\alpha\_ fa}(i)}}} & (4)\end{matrix}$

When the face score SCORE_fa is larger than 0, the image defined by thedetection frame FR-fa is determined to be a face image. On the otherhand, when the face score SCORE_fa is equal to or smaller than 0, theimage defined by the detection frame FR-fa is determined not to be aface image. Note that not only 0 but also any value other than 0 whichis slightly adjusted may be used as a criterion value for thedetermination.

Note that face images of various sizes may be included in thestill-image frame IM-0. Therefore, when face images are detected bysetting the detection frame FR-fa having a predetermined size in thestill-image frame IM-0 as shown in FIG. 10, only face imagescorresponding to the size of the detection frame FR-fa are detected.Therefore, in order to detect face images of various sizes included inthe still-image frame IM-0, the face-image detection processing isperformed on, in addition to the image in the still-image frame IM-0,reduced images IM-0 a to IM-0 d which are obtained by appropriatelyreducing the size of the still-image frame IM-0 as shown in FIG. 13.

FIG. 14 is a flowchart illustrating a procedure of the face-imagedetection processing performed by the face detection unit 102.

In step ST21, the face detection unit 102 starts the face-imagedetection processing, and proceeds to step ST22. In step ST22, the facedetection unit 102 sets a reduction-step value S_NO of the still-imageframe IM-0 to 1. In step ST23, the face detection unit 102 reads imageinformation in the still-image frame IM-0 from the storage unit,performs scaling (size-reduction processing) corresponding to thereduction-step value S_NO, and generates a reduced image (still-imageframe in which the size thereof is reduced) used to detect face images.

Note that when the reduction-step value S_NO is 1, a reduction rate is1, that is, a reduced image used to detect face images has the same sizeas the still-image frame IM-0. Furthermore, the larger thereduction-step value S_NO is, the smaller the reduction rate is. A faceimage detected using a reduced image having a smaller reduction rate isa larger face image in the still-image frame IM-0. Note thatface-detection-frame information (location information and sizeinformation) used here is that of the still-image frame IM-0.

In step ST24, the face detection unit 102 sets the detection frame FR-faon an upper left of the reduced image generated in step ST23. In stepST25, the face detection unit 102 measures a face score SCORE_fa usingthe face dictionary as described above.

In step ST26, the face detection unit 102 determines whether the imagedefined by the detection frame FR-fa is a face image in accordance withthe face score SCORE_fa measured in step ST25. In this case, when theface score SCORE_fa is larger than 0, the face detection unit 102determines that the image defined by the detection frame FR-fa is a faceimage whereas when the face score SCORE_fa is not larger than 0, theface detection unit 102 determines that the image defined by thedetection frame FR-fa is not a face image.

When the face detection unit 102 determined that the image defined bythe detection frame FR-fa is a face image, the face detection unit 102proceeds to step ST27. In step ST27, the face detection unit 102 adds aface ID to the detected face image and stores information (face-imageinformation) on the image defined by the detection frame FR-fa in thestorage unit along with the face-detection-frame information (locationinformation and size information). Note that, as described above, theface detection unit 102 stores information representing the face imageof S pixels×S pixels in the storage unit after normalizing the faceimage so as to have a size of 80 pixels×80 pixels which is to beprocessed by the face-feature-value calculation unit 103.

After step ST27, the face detection unit 102 proceeds to step ST28. Whenit is determined that the image defined by the detection frame FR-fa isnot a face image in step ST26, the face detection unit 102 directlyproceeds to step ST28. In step ST28, the face detection unit 102determines whether the detection frame FR-fa has reached the end of thestill-image frame IM-0. When the determination is negative in step ST28,the face detection unit 102 proceeds to step ST29 where the detectionframe FR-fa is moved to the next position. Thereafter, the facedetection unit 102 returns to step ST25, and the processing the same asdescribed above is performed again. Note that a certain verticalposition of the detection frame FR-fa is moved by one pixel in ahorizontal direction. After the movement in the horizontal direction ofthe vertical position is terminated, the detection frame FR-fa is movedby one pixel in a vertical direction so as to be moved to the nextvertical position.

When the determination is affirmative in step ST28, the face detectionunit 102 determines whether the reduction-step value S_NO corresponds tothe last reduction-step value S_NOmax in step ST30. When thedetermination is negative in step ST30, the face detection unit 102 setsthe next reduction-step value S_NO+1 in step ST31. Thereafter, the facedetection unit 102 returns to step ST23, and the processing the same asdescribed above is performed again.

When the determination is affirmative in step ST30, the face-imagedetection processing has been performed on face images corresponding toall the reduction steps S_NO. Therefore, the face detection unit 102terminates the face-image detection processing in step ST32.

As described above, when the face images are detected from thestill-image frame (still image), the face detection unit 102 detects theface-rotation angles representing angles of faces in the face images. Asdescribed above, when detecting the face images using the facedictionary which is learned by the machine learning algorithm such asAdaBoost, the face detection unit 102 simultaneously uses different facedictionaries for different face-rotation angles.

When detecting a face image, the face detection unit 102 determines aface-rotation angle corresponding to a face dictionary used in thedetection processing to be a face-rotation angle representing an angleof a face corresponding to the detected face image. Note that, when facescores SCORE_fa measured using the plurality of face dictionaries arelarger than 0, a face-rotation angle corresponding to a face dictionaryused to obtain the largest face score SCORE_fa is determined to be aface-rotation angle representing an angle of the detected face image. Instep ST27 of FIG. 10, the face detection unit 102 also storesinformation on the face-rotation angle in the storage unit.

Face-Feature-Value Calculation Unit

The face-feature-value calculation unit 103 calculates face featurevalues of the face images detected by the face detection unit 102 inaccordance with the image information items (face-image informationitems) regarding the face images, and stores the face feature values inthe storage unit. Furthermore, the face-feature-value calculation unit103 calculates smile scores representing degrees of smile and contrastscores representing degrees of contrast in accordance with the imageinformation items regarding the face images, and stores the smile scoresand the contrast scores in the storage unit. Then, theface-feature-value calculation unit 103 supplies the face featurevalues, the smile scores, and the contrast scores to the noise-faceremoving unit 104 in a successive stage at an appropriate timing.

The face-feature-value calculation unit 103 detects face-featurepositions, such as positions of both ends of an eyebrow, both ends of aneye, the center of the eyebrow, and the center of the eye, andcalculates local-feature-value vectors (identification feature vectors)in the face-feature positions using a convolution operation such asGabor filter. The face-feature-value calculation unit 103 detects theface-feature positions in accordance with the face-image informationitems and face-rotation-angle information items using a certain method,for example, a method referred to as an AAM (Active Appearance Models).This AAM is referred to in the following document.

F. Cootes, G. J. Edwards, and C. J. Taylor, “Active Appearance Models”,Proc. Fifth European Conf. Computer Vision, H. Burkhardt and B. Neumann,eds, vol. 2, pp. 484-498, 1998

In the AAM method, face-feature positions of face images correspondingto faces in various angles in certain limited regions are accuratelydetected. Therefore, when the face-feature positions are to be detectedusing the AAM method, there is a demand for a system in which differentface-feature positions of face images corresponding to faces indifferent angles are detected for individual regions in which theface-feature positions are to be accurately detected. For example, aplurality of detectors (not shown) for the different angles which detectthe face-feature positions are disposed, and an appropriate one of thedetectors is used in accordance an angle represented by face angleinformation.

When detecting the face-feature positions using the AAM method, theface-feature-value calculation unit 103 selects one of the plurality ofdetectors suitable for the face-rotation angle represented by theface-rotation-angle information, supplies the face image information tothe selected detector, and detects the face-feature positions.

The face-feature positions detected by the face-feature-valuecalculation unit 103 correspond to positions shown in (A) and (B) ofFIG. 15, for example. Note that (A) of FIG. 15 is a diagram illustratingface-feature positions detected in a face image captured from the frontof a face, and (B) of FIG. 15 is a diagram illustrating face-featurepositions detected in a face image captured at a 45-degree angle. In (A)and (B) of FIG. 15, portions denoted by x-marks are to be detected asthe face-feature positions.

Referring to (A) of FIG. 15, 17 points are detected as the face-featurepositions, including both ends of each of the eyebrows (four points intotal including two points in the right eyebrow and two points in theleft eyebrow), both ends of each of the eyes and the center (black eyes)of each of the eyes (six points in total including three points in theright eye and three points in the left eye), both ends and the center ofthe nose (three points in total), both ends and the center of the mouth(four points in total including two points corresponding to both ends ofthe mouth, one point corresponding to the center of the upper lip, andone point corresponding to the center of the lower lip). In thisembodiment, the description is continued assuming that 17 face-featurepositions are detected in a single face image.

The face-feature positions (denoted by the x-marks) of (A) of FIG. 15and the corresponding face-feature positions (denoted by the x-marks) of(B) of FIG. 15 are connected to each other by solid lines so that theassociation relationships are made apparent (note that only theassociation relationships in the face-feature positions in the eyebrowsand the association relationships in the eyes are shown).

The face-feature-value calculation unit 103 detects the face-featurepositions for individual face images detected by the face detection unit102, and calculates local-feature-value vectors (identification featurevectors) serving as the face feature values in accordance withface-feature-position information items and the face-image informationitems for individual face-feature positions. Examples of a method forcalculating the local-feature-value vectors performed by theface-feature-value calculation unit 103 include a calculation methodusing an image in the vicinity of a face-feature position of interestand a method using convolution calculation such as Gabor filter orGaussian Derivative Filter. In this embodiment, the description iscontinued assuming that the local-feature-vectors are extracted usingGabor filter.

Processing of Gabor filter (Gabor-Filtering) will now be described. Asit is generally known, optical cells of human beings include cells eachof which has selectivity for specific orientations. The optical cells ofhuman beings include cells which react to vertical lines and cells whichreact to horizontal lines. As with the optical cells of human beings,Gabor filter is a spatial filter including a plurality of filters eachof which has orientation selectivity.

Gabor filter is spatially expressed by Gabor function. As shown inExpression (5), Gabor function g(x, y) is constituted by a carrier s(x,y) including a cosine component and an envelope W_(r)(x, y)corresponding to two-dimensional Gaussian distribution.

g(x,y)=s(x,y)W _(r)(x,y)   (5)

The carrier s(x, y) is represented by Expression (6) using a pluralityof functions. Here, a coordinate value (u₀, v₀) denotes a spatialfrequency, and P denotes a phase of the cosine component.

s(x,y)=exp(j(2π(u ₀ x+v ₀ y)+P))   (6)

The carrier represented by Expression (6) can be divided into areal-number component Re(s(x, y)) and an imaginary-number componentIm(s(x, y)) as shown in Expression (7).

Re(s(x,y))=cos(2π(u ₀ x+v ₀ y)+P)

Im(s(x,y))=sin(2π(u ₀ x+v ₀ y)+P)   (7)

On the other hand, the envelope corresponding to the two-dimensionalGaussian distribution is expressed by Expression (8).

Wr(x,y)=K exp(−π(a ²(x−x ₀)r ² +b ²(y−y ₀)_(r) ²))   (8)

Here, the coordinate origin (x₀, y₀) represents a peak of this function,and constants a and b are scale parameters of Gaussian distribution. Asubscript r represents a rotation operation expressed by Expression (9).

(x−x ₀)_(r)=(x−x ₀)cos θ+(y−y ₀)sin θ

(y−y ₀)_(r)=−(x−x ₀)sin θ+(y−y ₀)cos θ  (9)

Accordingly, from Expressions (6) and (8), Gabor filter is representedby a spatial function as shown in Expression (10).

g(x,y)=K exp(−π(a ²(x−x ₀)_(r) ² +b ²(y−y ₀)_(r) ²))exp(j(2π(u ₀ x+v ₀y)+P))   (10)

In this embodiment, the face-feature-value calculation unit 103 performscalculation processing for individual face-feature positions of eyes, amouth, and a nose in a face using 17 Gabor filters.

Assuming that an i-th Gabor filter is denoted by Gi, a result (GaborJet) obtained from the i-th Gabor filter is denoted by Ji, and an inputimage is denoted by I, a response from the Gabor filter Gi isrepresented by Expression (11).

j _(i)(x,y)=G _(i)(x,y){circle around (×)}I(x,y)   (11)

The calculation of Expression (11) may be performed at high speed usinga fast Fourier transformation. In the following description, localfeature values obtained through Expression (11) are determined to belocal-feature-value vectors (identification feature vectors) which aredefined as Expression (12) below.

J _(i) ={j _(i-1) ,j _(i-2) , . . . j _(i-n)}  (12)

As described above, the face-feature-value calculation unit 103calculates the local-feature-value vectors (identification featurevectors) serving as the feature values for individual face-featurepositions. That is, the face-feature-value calculation unit 103calculates a group of 17 local-feature-value vectors corresponding tothe 17 face-feature positions for each face image as shown in Expression(13), and stores results of the calculations in the storage unit.

J ₁ ={j ₁₋₁ ,j ₁₋₂ ,j ₁₋₃ , . . . ,j _(1-n)}

J ₂ ={j ₂₋₁ ,j ₂₋₂ ,j ₂₋₃ , . . . ,j _(2-n)}

J ₃ ={j ₃₋₁ ,j ₃₋₂ ,j ₃₋₃ , . . . ,j _(3-n)}

J ₁₇ ={j ₁₇₋₁ ,j ₁₇₋₂ ,j ₁₇₋₃ , . . . ,j _(17-n)}  (13)

The face-feature-value calculation unit 103 calculates the smile scoresrepresenting degrees of smile in accordance with the image informationitems (face-image information items) of the face images detected by theface detection unit 102. As shown in FIG. 16, the face-feature-valuecalculation unit 103 performs normalization (affine transformation) onthe face image IM-2 so that the left eye and the right eye are locatedat predetermined coordinates so as to generate a normalized face imageIM-3 having a predetermined size, i.e., a horizontal size of 48 pixelsand a vertical size of 48 pixels in this embodiment.

Note that the number of pixels (48 pixels×48 pixels) of the face imageIM-3 which has just been normalized in accordance with the positions ofthe left and right eyes is smaller than the number of pixels (80pixels×80 pixels) of the face image IM-2 which has previously beennormalized. This is because the face image IM-2 should have the largenumber of pixels (resolution) to some extent so that the face featurevalues of the face image are accurately detected. However, thenormalized face image IM-3 is used to detect a feature (smile score) ofan entire face, and therefore, even the small number of pixels iseffective. Since the normalized face image IM-3 has the small number ofpixels, memory usage is reduced, and the processing of detecting thefeature is readily performed at high speed.

As shown in FIG. 16, the face-feature-value calculation unit 103measures a face score SCORE_sm using the smile dictionary. The facescore SCORE_sm is used to determine whether the normalized face imageIM-3 includes smiling-face image.

Processing of measuring the face score SCORE_sm will be described. Theface dictionary includes t3 combinations (several hundreds combinations)of pix_sm1(i), pix_sm2(i), θ_sm(i), and α_sm(i) as shown in (B) of FIG.17. Here, pix_sm1(i) and pix_sm2(i) denote positions of two points inthe normalized face image IM-3. Furthermore, θ_sm(i) denotes a thresholdvalue of a difference between a luminance value of pix_sm1(i) and aluminance value of pix_sm2(i). Moreover, α_sm(i) denotes weight to beadded or reduced in accordance with a result of comparison between thedifference between the luminance value of pix_sm1(i) and the luminancevalue of pix_sm2(i) and the threshold value θ_sm(i). The values ofpix_sm1(i), pix_sm2(i), θ_sm(i), and α_sm(i) are obtained by beinglearned by the machine learning algorithm such as AdaBoost.

As shown in (A) of FIG. 17, the measurement of the face score SCORE_smis performed as follows. It is determined whether each of thecombinations of pix_sm1(i), pix_sm2(i), θ_sm(i), and α_sm(i) satisfiesExpression (14). When the determination is affirmative, Expression (15)is performed. On the other hand, when the determination is negative,Expression (16) is performed. Note that, in Expression (14), pix_sm1(i)denotes a luminance value of its position, and pix_sm2(i) denotes aluminance value of its position.

pix_(—) sm1(i)−pix_(—) sm2(i)<θ_(—) sm(i)   (14)

SCORE_(—) sm=SCORE_(—) sm+α _(—) sm(i)   (15)

SCORE_(—) sm=SCORE_(—) sm−α _(—) sm(i)   (16)

FIG. 18 is a flowchart illustrating a procedure of the processing ofmeasuring the smile score SCORE_sm using the smile dictionary. In stepST71, the face-feature-value calculation unit 103 starts thescore-measurement processing, and proceeds to step ST72. In step ST72,the face-feature-value calculation unit 103 sets the face score SCORE_smto 0. In step ST73, the face-feature-value calculation unit 103 sets ito 1.

In step ST74, the face-feature-value calculation unit 103 selectsluminance values corresponding to pix_sm1(i) and pix_sm2(i). In stepST75, the face-feature-value calculation unit 103 subtracts theluminance value of pix_sm2(i) from the luminance value of pix_sm1(i). Instep ST76, the face-feature-value calculation unit 103 determineswhether a result (pix_sm1(i)−pix_sm2(i)) of the calculation is smallerthan the threshold value θ_sm(i) (refer to Expression (14)).

When the determination is affirmative in step ST76, theface-feature-value calculation unit 103 proceeds to step ST77 and addsthe weight α_sm(i) to the face score SCORE_sm (refer to Expression(15)). On the other hand, when the determination is negative in stepST76, the face-feature-value calculation unit 103 proceeds to step ST78where the weight a_sm(i) is subtracted from the face score SCORE_sm(refer to Expression (16)).

After step ST77 or step ST78, the face-feature-value calculation unit103 proceeds to step ST79. In step ST79, the face-feature-valuecalculation unit 103 increments i by one. In step ST80, theface-feature-value calculation unit 103 determines whether i is largerthan t3. When the determination is affirmative in step ST80, it isdetermined that the processing is performed on all the t3 combinationsincluded in the smile dictionary, and the processing of measuring asmile score is terminated in step ST81. On the other hand, when thedetermination is negative in step ST80, the face-feature-valuecalculation unit 103 returns to step ST74, and performs the processingdescribed above again.

The face-feature-value calculation unit 103 calculates the smile scoresfor individual face images detected by the face detection unit 102 asdescribed above, and stores the smile scores in the storage unit.

The face-feature-value calculation unit 103 calculates the contrastscore representing degrees of contrast in accordance with the imageinformation items (face-image information items) of the face imagesdetected by the face detection unit 102. The face-feature-valuecalculation unit 103 calculates a contrast score ContrastScore by addingsquare values of differences between luminance values of adjacentpixels, which are obtained for individual pixels, to one another inaccordance with the image information items of the face images.

As shown (A) of FIG. 19, in the processing of calculating the contrastscore ContrastScore, a block BL having a size of 2 pixels×2 pixels isset in the face image IM-2 having the size of 80 pixels×80 pixels. Amongthe four pixels included in the block BL, a position of an upper-leftpixel is denoted by (x, y), a position of a lower-left pixel is denotedby (x, y−1), a position of an upper-right pixel is denoted by (x+1, y),and a position of a lower-right pixel is denoted by (x+1, y+1).

The face-feature-value calculation unit 103 successively moves the blockBL by changing the values x and y in a range from 0 to 78, andsuccessively adds square values of differences between luminance valuesof adjacent pixels, which are obtained for individual pixels, to oneanother. In this way, the contrast score ContrastScore is obtained.

It is assumed that a difference between a luminance value of the pixel(x, y) and a luminance value of the pixel (x+1, y) is denoted by [I(x,y)−I(x+1, y)], a difference between a luminance value of the pixel (x,y) and a luminance value of the pixel (x, y+1) is denoted by [I(x,y)−I(x, y+1)], a difference between a luminance value of the pixel (x,y) and a luminance value of the pixel (x+1, y+1) is denoted by [I(x,y)−I(x+1, y+1)], and a difference between a luminance value of the pixel(x, y+1) and a luminance value of the pixel (x+1, y) is denoted by [I(x,y+1)−I(x+1, y)], the contrast score ContrastScore is represented byExpression (17). Note that, in Expression (17), N denotes the number ofpixels of the face image, and N is 80×80 in this embodiment.

$\begin{matrix}{{{B\; C\; S} = {{\frac{1}{N}\begin{Bmatrix}\begin{matrix}\begin{matrix}{{\sum\limits_{x,y}\left\lbrack {{I\left( {x,y} \right)} - {I\left( {{x + I},y} \right)}} \right\rbrack^{2}} +} \\{{\sum\limits_{x,y}\left\lbrack {{I\left( {x,y} \right)} - {I\left( {x,{y + 1}} \right)}} \right\rbrack^{2}} +}\end{matrix} \\{{\sum\limits_{x,y}\left\lbrack {{1\left( {x,y} \right)} - {1\left( {{x + 1},{y + 1}} \right)}} \right\rbrack^{2}} +}\end{matrix} \\{\sum\limits_{xy}\left\lbrack {{1\left( {x,{y + 1}} \right)} - {1\left( {{x + 1},y} \right)}} \right\rbrack^{2}}\end{Bmatrix}x} \in \left( {0,8,{0 - 2}} \right)}},\mspace{79mu} {y \in \left( {0,{80 - 2}} \right)},{N = {80 \times 80}}} & (17)\end{matrix}$

FIG. 20 is a flowchart illustrating a procedure of processing ofobtaining the contrast score ContrastScore of the face image IM-2. Instep ST91, the face-feature-value calculation unit 103 starts theprocessing of obtaining a contrast score, and proceeds to step ST92. Instep ST92, the face-feature-value calculation unit 103 calculates thecontrast score by adding square values of differences between theluminance values among the pixels included in the block BL (2×2 pixels)to one another.

In step ST93, the face-feature-value calculation unit 103 determineswhether a portion to which the block BL is to be moved exists. When aportion to which the block BL is to be moved exists in ranges of x and yof 0 to 78, the face-feature-value calculation unit 103 determines thatthe portion to which the block BL is to be moved exists. When thedetermination is affirmative in step ST93, the face-feature-valuecalculation unit 103 returns to step ST92, and the next portioncorresponding to the block BL is processed.

When the determination is negative in step ST93, the face-feature-valuecalculation unit 103 proceeds to step ST94 where the face-feature-valuecalculation unit 103 divides a total addition value by the number ofpixels N of the face image IM-2 so that the contrast score ContrastScoreis obtained. After step ST94, the face-feature-value calculation unit103 terminates the processing in step ST95.

The face-feature-value calculation unit 103 calculates the contrastscores for individual face images detected by the face detection unit102 as described above, and stores the contrast scores in the storageunit.

FIG. 21 is a flowchart illustrating a procedure of operations performedby the face detection unit 102 and the face-feature-value calculationunit 103 every time still-image frames (still images) are extracted froma moving-image stream by the decoding unit 101.

When each of the still-image frames is extracted by the decoding unit101, the face detection unit 102 and the face-feature-value calculationunit 103 start processing in step ST101. In step ST102, the facedetection unit 102 converts information on an image in the still-imageframe into grayscale. When a YUV format is employed as a format of theinput image, the face detection unit 102 extracts only a Y component.When an RGB format is employed as the format of the input image, theface detection unit 102 calculates the Y component as shown in thefollowing expression.

Y=(0.299*R+0.587*G+0.114*B)

In step ST103, the face detection unit 102 detects face images inaccordance with the image information of the still-image frame which hasbeen converted into grayscale, and further detects face-rotation anglesrepresenting angles of faces represented by the face images (refer toFIGS. 9 to 14).

In step ST104, the face-feature-value calculation unit 103 calculates asmile score SCORE_sm in accordance with information on one of the faceimages detected by the face detection unit 102 (refer to FIGS. 16 to18). In step ST105, the face-feature-value calculation unit 103calculates a contrast score ContrastScore in accordance with theinformation on the one of the face images detected by the face detectionunit 102 (refer to FIGS. 19 and 20) In step ST106, theface-feature-value calculation unit 103 detects face-feature positionsin accordance with the information on the one of the face imagesdetected by the face detection unit 102 (refer to FIG. 15) so as toobtain a face feature value (local-feature-value vector).

In step ST107, the face-feature-value calculation unit 103 determineswhether all the face images detected by the face detection unit 102 havebeen processed. When the determination is negative in step ST107, theface-feature-value calculation unit 103 returns to step ST104, andcalculates a smile score SCORE_sm, a contrast score ContrastScore, and aface feature value of the next face image.

When the determination is affirmative in step ST107, theface-feature-value calculation unit 103 proceeds to step ST108 where theprocessing is terminated.

Note that, in the flowchart of FIG. 21, in a case where the informationon the image in the still-image frame (still image) which is suppliedfrom the decoding unit 101 to the face detection unit 102 has alreadybeen converted into grayscale, the processing of converting theinformation on the image in the still-image frame (still image)performed by the face detection unit 102 (processing of step ST102) iseliminated. Furthermore, in the flowchart of FIG. 21, the operations ofstep ST104 to step ST106 are not necessarily performed in this order.

Noise-Face Removing Unit

The noise-face removing unit 104 removes face images including images ofside faces or blurred face images which may adversely affect toprocessing of the identical-faces-merging processor 105 and processingof the face clustering unit 106 in a succeeding stage. The noise-faceremoving unit 104 removes noise-face images (such as side-face imagesand blurred face images) in accordance with face data items (refer toFIG. 4) corresponding to the face images supplied from theface-feature-value calculation unit 103.

FIG. 22 is a flowchart illustrating a procedure of processing ofremoving noise-face images performed by a noise-face removing unit 104.Every time the face data items corresponding to the face images detectedby the face detection unit 102 are supplied from the face-feature-valuecalculation unit 103, the noise-face removing unit 104 performsnoise-face removing processing shown in the flowchart of FIG. 22successively on the face images serving as objects to be processed.

In step ST111, the noise-face removing unit 104 starts the processing,and proceeds to step ST112. In step ST112, the noise-face removing unit104 determines whether a face image of interest is a side-face image,that is, the noise-face removing unit 104 checks information on aface-rotation angle included in face data of the face image of interest.

In step ST113, the noise-face removing unit 104 determines whether a yawangle is within a threshold range. The threshold range is ±45 degrees,for example. A face image shown in FIG. 23A has a yaw angle of −5degrees, and therefore, is not a side-face image, and a face image shownin FIG. 23B has a yaw angle of +50 degrees, and therefore, is aside-face image (noise-face image), for example.

When the determination is negative in step ST113 (refer to FIG. 23B),the noise-face removing unit 104 determines that the face image ofinterest is a noise-face image (side-face image), and removes the faceimage of interest in step ST114. After step ST114, the noise-faceremoving unit 104 terminates the processing in step ST115.

On the other hand, when the determination is affirmative in step ST113,the noise-face removing unit 104 proceeds to step ST116. In step ST116,the noise-face removing unit 104 determined whether the face image ofinterest is a blurred face image, that is, the noise-face removing unit104 checks a contrast score included in the face data corresponding tothe face image of interest.

In step ST117, the noise-face removing unit 104 determines whether thecontrast score is larger than a threshold value. The threshold value is150, for example. A face image shown in FIG. 24A has a contrast score of350, and therefore, is not a blurred face image, and a face image shownin FIG. 24B has a contrast score of 120, and therefore, is a blurredface image (noise-face image), for example.

When the determination is negative in step ST117, the noise-faceremoving unit 104 proceeds to step ST114 where the noise-face removingunit 104 determines that the face image of interest is a noise-faceimage (blurred face image), and removes the face image of interest.After step ST114, the noise-face removing unit 104 terminates theprocessing in step ST115.

On the other hand, when the determination is affirmative in step ST117,the noise-face removing unit 104 determines that the face image ofinterest is not a noise-face image, and therefore, does not remove theface image of interest in step ST118. After step ST118, the noise-faceremoving unit 104 terminates the processing in step ST115.

Note that, in the flowchart of FIG. 22, when the yaw angle of the faceimage of interest is out of the threshold range, the noise-face removingunit 104 determines that the face image of interest is a side-face image(noise-face image) and removes the face image of interest. In addition,when a pitch angle of the face image of interest is out of a thresholdrange, the noise-face removing unit 104 may determine that the faceimage of interest is an image of an upturned face or an image of adownturned face (noise face) and may remove the face image of interest.

Identical-Faces-Merging Processor

Every time face data items in a current frame is supplied from thenoise-face removing unit 104, the identical-faces-merging processor 105performs processing of merging identical face images. Theidentical-faces-merging processor 105 determines whether a person in aface image detected in the current frame is identical to a person in aface image which has been detected in a previous frame and which hasbeen stored. In this case, for the determination, theidentical-faces-merging processor 105 sets individual threshold valuesto a degree of similarity calculated in accordance with face featurevalues of the two face images, positions of face-detection frames in thetwo face images, sizes of the face-detection frames, and an interval(frame interval) between frames of the two face images.

FIG. 25 is a flowchart illustrating a procedure of identical-facemerging processing performed by the identical-faces-merging processor105. When receiving each of the face data items representing the faceimages of the current frame (except for the noise-face images) from thenoise-face removing unit 104, the identical-faces-merging processor 105successively performs the identical-face-combining processing on each ofthe face images as shown in FIG. 25.

In step ST121, the noise-face removing unit 104 starts processing, andproceeds to step ST122. In step ST122, the identical-faces-mergingprocessor 105 calculates a degree of similarity between the face imageof interest in the current frame (current face image) and one of theface images which have been detected in the previous frame and whichhave been stored (previous face image). In this case, theidentical-faces-merging processor 105 calculates the degree ofsimilarity using local-feature-value vectors (refer to Expression (13))of the current face image and the previous face image serving as facefeature values calculated by the face-feature-value calculation unit103.

Here, a method for obtaining the degree of similarity will be described.The degree of similarity between the current face image and the previousface image is obtained using the local-feature-value vectors (facefeature values) of the two face images. In this case, in a case where aface-rotation angle of the current face image and a face-rotation angleof the previous face image are different from each other (refer to (A)and (B) of FIG. 15), if the local-feature-value vectors of the two faceimages are used without any change, accuracy of calculation of thedegree of similarity is degraded. Therefore, in the case where theface-rotation angles of the two face images are different from eachother, the face-feature-value calculation unit 103 converts, forexample, the local-feature-value vector of the previous face image intoa local-feature-value vector corresponding to an angle of a facecorresponding to the current face image using a mapping function, andthereafter, obtains the degree of similarity.

In a case where the face-rotation angle of the current face image is setto 0 degree (refer to (A) of FIG. 15) and the face-rotation angle of theprevious face image is set to 45 degrees (refer to (B) of FIG. 15),mapping processing will be described. In this case, thelocal-feature-value vector of the current face image is represented byExpression (18), and the local-feature-value vector of the previous faceimage is represented by Expression (19). Note that superscripts ofcharacters J and j denote the face-rotation angles. The character idenotes a number used to identify a face-feature position. In thisembodiment, since the local-feature-value vectors corresponding to the17 face-feature positions are to be calculated, the character icorresponds to one of numbers 1 to 17.

J _(i) ⁰ ={j _(i-1) ⁰ ,j _(i-2) ⁰ , . . . ,j _(i-n) ⁰}  (18)

J _(i) ⁴⁵ ={j _(i-1) ⁴⁵ ,j _(i-2) ⁴⁵ , . . . ,j _(i-n) ⁴⁵}  (19)

The mapping processing is performed so that the local-feature-valuevector extracted from the face image corresponding to a face at an angleof 45 degrees is converted so as to correspond to thelocal-feature-value vector extracted from the face image correspondingto a face at an angle of 0 degree using the mapping function. Expression(20) denotes the local-feature-value vector obtained after the mappingprocessing. In Expression (20), “˜” on upper sides of the characters Jand j represents that J and j are approximate values.

{tilde over (J)} _(i) ⁰ ={{tilde over (j)} _(i-1) ⁰ ,{tilde over (j)}_(i-2) ⁰ , . . . ,{tilde over (j)} _(i-n) ⁰}  (20)

Elements included in Expression (20) (elements included in “{ }” on theright side of Expression (20)) are calculated using Expression (21).

$\begin{matrix}{{{\overset{\sim}{j}}_{i - 1}^{0} = {f_{i - 1}^{45}\left( {j_{i - 1}^{45},j_{1 - 2}^{45},\ldots \mspace{14mu},j_{i - n}^{45}} \right)}}{{\overset{\sim}{j}}_{i - 2}^{0} = {f_{i - 2}^{45}\left( {j_{i - 1}^{45},j_{i - 2}^{45},\ldots \mspace{14mu},j_{i - n}^{45}} \right)}}\mspace{160mu} \vdots {{\overset{\sim}{j}}_{i - n}^{0} = {f_{i - n}^{45}\left( {j_{i - 1}^{45},j_{i - 2}^{45},\ldots \mspace{14mu},j_{i - n}^{45}} \right)}}} & (21)\end{matrix}$

That is, an element j included in Expression (20) is obtained by apredetermined mapping function f using all elements (n elements jincluding Ji-1 to Ji-n) included in Expression (19). In this case, themapping function f is compatible with the angle of the face included inthe previous face image. Furthermore, different mapping functions f areprepared for different face-feature positions. That is, since the 17face-feature positions are detected in this embodiment, 17 mappingfunctions f are provided for each angle.

General expressions for the mapping processing are represented asfollows.

J _(i) ^(θ) ¹ ={j _(i-1) ^(θ) ¹ ,j _(i-2) ^(θ) ¹ , . . . ,j _(i-n) ^(θ)¹ }  (22)

J _(i) ^(θ) ^(R) ={j _(i-1) ^(θ) ^(R) ,j _(i-2) ^(θ) ^(R) , . . . ,j_(i-n) ^(θ) ^(R) }  (23)

{tilde over (J)} _(i) ^(θ) ^(R) ={j _(i-1) ^(θ) ^(R) ,j _(i-2) ^(θ) ^(R), . . . ,j _(i-n) ^(θ) ^(R) }  (24)

{tilde over (j)} _(i-k) ^(θ) ^(R) =f _(i-k) ^(θ) ^(1,) ^(θ) ^(R) (j_(i-1) ^(θ) ¹ ,j _(i-2) ^(θ) ¹ , . . . ,j _(i-n) ^(θ) ¹ ) (k=1, . . .,n)   (25)

Expression (22) represents a local-feature-value vector at a featureposition i included in the previous face image corresponding to a facehaving an angle of θI. Expression (23) denotes a local-feature-valuevector at a feature position i included in the current face imagecorresponding to a face having an angle of θR. Expression (24) denotes alocal-feature-value vector obtained by performing the mapping processingso that the local-feature-value vector at the feature position i of theprevious face image obtained by Expression (22) is converted so as tocorrespond to the local-feature-value vector extracted from the faceimage corresponding to the face at the angle of θR.

Expression (25) represents elements on the right side of Expression(24). That is, the left side of Expression (25) denotes an estimatevalue of the k-th element of the local-feature-value vector at thefeature position i. Among the right side of Expression (25),

f_(i-k) ^(θ) ^(1,) ^(θ) ^(R) ( )

is a mapping function for a feature value which is used to perform themapping processing on the k-th element of the local-feature-value vectorat the feature position i of the face image corresponding to the facehaving the angle of θR using all the elements of the local-feature-valuevector at the feature position i of the face image corresponding to theface having the angle of θI.

Note that, although all the elements are used for the mapping processingin this embodiment, all the elements are not necessarily used for themapping processing. For example, among all the elements, elements whichare basically used for the estimation may be determined so as to be usedfor the mapping processing (so as to be assigned to the mappingfunction). That is, in a case where a local-feature-value vector to beinput and a local-feature-value vector obtained after the mappingprocessing has an apparent cause-and-effect relationship with eachother, the mapping processing is not performed using all elements of theinput local-feature-value vector as input variables of the mappingfunction, but is performed using only the elements which have determinedto have the cause-and-effect relationships.

Then, the identical-faces-merging processor 105 calculates the degree ofsimilarity using normalized correlation calculation. When calculatingthe degree of similarity using the normalized correlation calculation,the identical-faces-merging processor 105 calculates a similarity vectorin accordance with Expression (26) and Expression (27).

c _(i) ⁰ =NC(J _(i) ⁰ ,{tilde over (J)} ₁ ⁰)   (26)

C ⁰ ={c ₁ ⁰ ,c ₂ ⁰ , . . . ,c _(n) ⁰}  (27)

Elements included in Expressions (12) and (20) are successively assignedto Expression (26) whereby the normalized correlation calculation isperformed. By this, elements included in the similarity vector obtainedby Expression (27) are calculated. In other words, the degree ofsimilarity between identical face-feature positions of the previous faceimage and the current face image is calculated (refer to Expression(26)) using the local-feature-value vector of the previous face image(the local-feature-value vector which has been subjected to mappingconversion) (refer to Expression (20)) and the local-feature-valuevector of the current face image (refer to Expression (12)).

Note that Expressions (28) and (29) are used when the angle of the facecorresponding to the current face image is θR, and correspond toExpressions (26) and (27) above.

c _(i) ^(θ) ^(R) =NC(J _(i) ^(θ) ^(R) ,{tilde over (J)} _(i) ^(θ) ^(R) )  (28)

C ^(θ) ^(R) ={c ₁ ^(θ) ^(R) ,c ₂ ^(θ) ^(R) , . . . ,c _(n) ^(θ) ^(R)}  (29)

The identical-faces-merging processor 105 obtains a magnitude of thesimilarity vector (refer to Expressions (27) and (29)) calculated asdescribed above, and the magnitude is used as the degree of similarity.

Referring back to the flowchart of FIG. 25, after step ST122, theidentical-faces-merging processor 105 proceeds to step ST123. In stepST123, the identical-faces-merging processor 105 compares the degree ofsimilarity obtained in step ST122 with a threshold value Th1 (firstthreshold value). It is assumed that a maximum value of the degree ofsimilarity obtained in step ST122 is 100, and the threshold value Th1 is88.

In step ST124, the identical-faces-merging processor 105 determineswhether the degree of similarity is equal to or larger than thethreshold value Th1. When the determination is affirmative in stepST124, the identical-faces-merging processor 105 proceeds to step ST125and determines that the current face image and the previous face imageinclude the respective face images representing an identical person. Forexample, FIGS. 26A and 26B show examples of the previous face image andthe current face image, respectively. A degree of similarity of the twoface images is 88, for example, and therefore, it is determined thatthese face images represent an identical person.

In step S126, the identical-faces-merging processor 105 determines arepresentative face image from among the two face images. In this case,among the two face images, one of the face images which corresponds to aface facing the front the most or one of the face images which has thehighest contrast score is determined as the representative face image.In step ST127, the identical-faces-merging processor 105 stores facedata corresponding to the representative face image, and discards facedata which does not correspond to the representative face image. Afterstep ST127, the identical-faces-merging processor 105 proceeds to stepST128 where the processing is terminated.

On the other hand, when the determination is negative in step ST124, theidentical-faces-merging processor 105 proceeds to step ST129 andcompares the degree of similarity obtained in step ST122 with athreshold value Th2 (second threshold value). It is assumed that themaximum value of the degree of similarity obtained in step ST122 is 100,and the threshold value Th2 is 0.

In step ST1200, the identical-faces-merging processor 105 determineswhether the degree of similarity is equal to or larger than thethreshold value Th2. When the determination is affirmative in stepST1200, the identical-faces-merging processor 105 proceeds to stepST1201. For example, FIGS. 27A and 27B show examples of the previousface image and the current face image, respectively. A degree ofsimilarity of the two face images is 3, for example.

In step ST1201, the identical-faces-merging processor 105 comparesface-detection-frame information items of the two face images, andchecks information on an interval between frames of the two face images.In step ST1202, the identical-faces-merging processor 105 determineswhether face-detection-frame information items and the interval betweenthe frames satisfy certain conditions. For example, when a distancebetween the centers of the face-detection-frames is smaller than 80pixels, an area ratio of the face-detection frames is in a range from1:0.5 to 1:1.5, and the interval between the frames is smaller than 5.0seconds, it is determined that the conditions are satisfied. Note that80 pixels is an example of a threshold value of the distance between thecenters of the face-detection frames, area ratios 1:0.5 and 1:1.5 areexamples of threshold values of area ratios of the face-detectionframes, and 5.0 seconds is an example of a threshold value of theinterval between the frames.

When the conditions are satisfied, the identical-faces-merging processor105 determines that the current face image and the previous face imagerepresent an identical person in step ST125. Therefore, even when thedegree of similarity of the two face images is low due to a lightingcondition, for example, if a frame interval is short and positions andsizes of the face-detection frames are similar to each other, it isdetermined that the current face image and the previous face imagerepresent an identical person.

For example, FIG. 28A shows a still-image frame (frame 1) in which theprevious face image (refer to FIG. 27A) is detected by a face-detectionframe DF1, and FIG. 28B shows a still-image frame (frame 3) in which thecurrent face image (refer to FIG. 27B) is detected by a face-detectionframe DF2. In this case, a distance between the center of theface-detection frame DF1 and the center of the face-detection frame DF2is 30 pixels, an area ratio of the face-detection frame DF1 to theface-detection frame DF2 is 1:1.05, and an interval between the framesis 3.0 seconds. Accordingly, the conditions of the face-detection framesand the interval between frames are satisfied.

After step ST125, the identical-faces-merging processor 105 proceeds tostep ST126. An operation performed by the identical-faces-mergingprocessor 105 in step ST126 is the same as that described above, andtherefore, description thereof is omitted.

When the determination is negative in step ST1200 or step ST1202, theidentical-faces-merging processor 105 proceeds to step ST1203. In stepST1203, the identical-faces-merging processor 105 determines whether allthe previous face images have been processed. When the determination isnegative in step ST1203, the identical-faces-merging processor 105returns to step ST122, and performs the processing using the currentface image of interest and the next previous face image.

When the determination is affirmative in step ST1203, theidentical-faces-merging processor 105 proceeds to step ST1204 anddetermines that the current face image of interest is a face imagecorresponding to a person newly appeared. In step ST1205, face datacorresponding to the current face image of interest is stored, andthereafter, the processing is terminated in step ST128.

Note that in the identical-faces-merging processing shown in theflowchart of FIG. 25, the determination as to whether the current faceimage and the previous face image represent an identical person is madein accordance with the detection-frame information items and theinformation on the interval between the frames of the two face images,in addition to the degree of similarity calculated from the face featurevalues of the current face image and the previous face image. However,the determination may be made only in accordance with the degree ofsimilarity calculated from the face feature values of the current faceimage and the previous face image. In this case, in the flowchart ofFIG. 25, when the degree of similarity is lower than the threshold valueTh1 in step ST124, the identical-faces-merging processor 105 directlyproceeds to step ST1203.

Furthermore, the identical-faces-merging processor 105 may make thedetermination in step ST1202 of the flowchart of FIG. 25 only inaccordance with the detection-frame information items of the face imagesor the information on the interval between the frames of the faceimages.

Face Clustering Unit

When the end of the moving-image stream is reached, the face clusteringunit 106 performs clustering processing on the face images ultimatelystored in the identical-faces-merging processor 105 so that face imagesof an identical person are assigned to a single cluster. In this way,characters in the moving-image stream are classified. In accordance witha result of the clustering processing, the face clustering unit 106determines a representative face image from among a plurality of faceimages included in the single cluster.

FIG. 29 is a flowchart illustrating a procedure of the face clusteringprocessing performed by the face clustering unit 106.

The face clustering unit 106 starts the processing in step ST131, andproceeds to step ST132. In step ST132, the face clustering unit 106calculates a similarity matrix. That is, the face clustering unit 106calculates degrees of similarity of pairs of face images extracted fromamong face images ultimately stored by the identical-faces-mergingprocessor 105 in accordance with feature values (local-feature-valuevectors) of the pairs of face images. Therefore, the face clusteringunit 106 corresponds to a similarity calculation unit. A method forobtaining the degrees of similarity is the same as that described in thedescription about the identical-faces-merging processor 105.

It is assumed that n face images are ultimately stored by theidentical-faces-merging processor 105, and the n face images haveindividual face IDs f1 to fn. In this case, the face clustering unit 106calculates the degrees of similarity of the pairs of face imagescorresponding to hatched portions of FIG. 30.

Furthermore, the face clustering unit 106 generates and stores aface-pair list by sorting the pairs of face images in a descending orderof degrees of similarity in accordance with results of the calculationsof the similarity matrix as shown in FIG. 31. The face-pair listincludes “rank”, “pair”, and “degree of similarity” as items. In theitem of “pair”, face IDs of pairs of face images are listed. In the itemof “degree of similarity”, the calculated degrees of similarity arelisted.

FIG. 32 is a flowchart illustrating a procedure of the calculation ofthe similarity matrix and processing of generating the face pairs listperformed by the face clustering unit 106. The face clustering unit 106starts the processing in step ST141, and proceeds to step ST142. In stepST142, the face clustering unit 106 calculates a degree of similarity ofone of the pairs of face images. In step ST143, the face clustering unit106 determines whether the next pair exists. When the determination isaffirmative in step ST143, the face clustering unit 106 returns to stepST142, and calculates a degree of similarity of the next pair of faceimages.

When the determination is negative in step ST143, the face clusteringunit 106 determines that the similarity matrix shown in FIG. 30 iscompleted, and proceeds to step ST144. In step ST144, the faceclustering unit 106 sorts the pairs of face images in an order of thedegrees of similarity using the similarity matrix so as to generate theface-pair list (refer to FIG. 31). After step ST144, the face clusteringunit 106 proceeds to step ST145 where the processing is terminated.

Referring back to the flowchart of FIG. 29, the face clustering unit 106performs layering/clustering processing in step ST133. In this case, theface clustering unit 106 performs the layering/clustering processing inaccordance with the face-pair list (refer to FIG. 31) generated in stepST132. In this case, the face clustering unit 106 generates a layeredstructure using a clustering method referred to as “Single Linkage”.Therefore, the face clustering unit 106 corresponds to alayering/clustering unit.

Specifically, the face clustering unit 106 determines the face imageswhich have been ultimately stored by the identical-faces-mergingprocessor 105 as individual clusters, and generates a number of leavesin the lowermost layer corresponding to the face images. Thereafter, theface clustering unit 106 refers to the face-pair list generated in stepST132, and successively merges the clusters including the face IDscorresponding to the pairs of face images in an order of the degrees ofsimilarity so as to finally obtain a single cluster.

The face clustering unit 106 stores node data items representing nodesincluded in the layered structure. FIG. 33 is a diagram illustrating aconfiguration of each of the node data items. Each of the node dataitems includes a node number, upper-node information, lower-nodeinformation, and a leaf list. The node number is an ID unique to each ofthe nodes. The upper-node information is a pointer to an upper-layernode, and is “NULL” in node data item of the uppermost node. Thelower-node information is a pointer to a lower-layer node, and is “NULL”in node data items of the lowermost node. The leaf list is a list offace IDs of leaves in the lowermost layer (terminal nodes) which havebeen retained, a single face ID is included in each of the node dataitems of the terminal nodes (lowermost layer).

FIG. 34 is a diagram illustrating an example of the layered structure ofthe nodes. In this layered structure of the nodes, 15 face images arefinally stored by the identical-faces-merging processor 105, and faceIDs f1 to f15 are assigned to the individual 15 face images. In thiscase, 15 lowermost leaves (terminal nodes) are generated. In the exampleof FIG. 34, node numbers 1 to 15 are assigned to the terminal nodescorresponding to the face IDs f1 to f15 for simplicity.

Referring back to the face-pair list of FIG. 31, since the first rank isassigned to a pair (f1, f3), a parent node having a node number of 16 isgenerated as an upper node of nodes which have node numbers of 1 and 3and which include the face IDs f1 and f3, respectively, in the leaflists thereof. Then, since the second rank is assigned to a pair (f7,f12), a parent node having a node number of 17 is generated as an uppernode of nodes which have node numbers of 7 and 12 and which include theface IDs f7 and f12, respectively, in the leaf lists thereof.

Then, since the third rank is assigned to a pair (f11, f9), a parentnode having a node number of 18 is generated as an upper node of nodeswhich have node numbers of 11 and 9 and which include the face IDs f11and f9, respectively, in the leaf lists thereof. Then, since the fourthrank is assigned to a pair (f15, f9), a parent node having a node numberof 19 is generated as an upper node of nodes which have node numbers of15 and 18 and which include the face IDs f15 and f9, respectively, inthe leaf lists thereof. In this way, the layered structure of the nodesis generated.

FIG. 35 is a diagram illustrating a concrete example of the 19th nodedata in the layered structure of the nodes. A node number “19” isassigned to the 19th node data. Upper-node information represents apointer toward the 26th node. Lower-node information represents pointerstoward the 15th and 18th node. A leaf list represents face IDs of leavesin the lowermost layer which have been retained, that is, the face IDsf9, f11, and f15.

FIG. 36 is a flowchart illustrating a procedure of the layeredclustering processing performed by the face clustering unit 106. Theface clustering unit 106 starts the processing in step ST151, andproceeds to step ST152. In step ST152, the face clustering unit 106generates a number of leaves in the lowermost layer corresponding to theface IDs. In step ST153, the face clustering unit 106 refers to theface-pair list.

In step ST154, the face clustering unit 106 determines whether two nodeseach having leaf lists including the pair of face IDs of the first rankare included in the generated leaves. When the determination isaffirmative in step ST154, the face clustering unit 106 proceeds to stepST155, and generates a parent node of the two nodes corresponding to thepair of face IDs of the first rank in step ST155.

After step ST155, the face clustering unit 106 proceeds to step ST156.When the determination is negative in step ST154, the face clusteringunit 106 directly proceeds to step ST156. In step ST156, the faceclustering unit 106 determines whether a pair of face IDs having thelowest rank has been reached. When the determination is negative in stepST156, the face clustering unit 106 returns to step ST154 where theprocessing is performed with reference to a pair of face IDs having thenext rank. On the other hand, when the determination is affirmative instep ST156, the face clustering unit 106 terminates the processing instep ST157.

Referring back to the flowchart of FIG. 29, the face clustering unit 106performs cluster-determining processing in step ST134. In this case, theface clustering unit 106 adjusts the clusters by over-mergingdetermination. Specifically, the face clustering unit 106 performs theover-merging determination as follows. The face clustering unit 106performs a determination as to whether over-merging occurs on theclusters starting from the cluster in the uppermost layer in accordancewith information items regarding the clusters (information on thelayered structure of the nodes) in a tree-shaped structure obtained bythe clustering processing for layering in step ST133. Then, the faceclustering unit 106 divides a cluster determined to have beenover-merged into two original clusters before being merged by thelayering/clustering processing of step ST133. The clusters are thusdetermined. Therefore, the face clustering unit 106 corresponds to acluster determination unit.

As shown in FIG. 37, the face clustering unit 106 successively stacks(pushes) the nodes starting from the uppermost node in a stack (memorystack), and thereafter, extracts (pops) the nodes so as to perform theover-merging determination for individual nodes.

FIG. 38 is a flowchart illustrating a procedure of the clusterdetermination processing performed by the face clustering unit 106. Theface clustering unit 106 starts the processing in step ST161, andproceeds to step ST162. In step ST162, the face clustering unit 106pushes the uppermost node into the stack.

In step ST163, the face clustering unit 106 determines whether the stackis empty. When the determination is negative in step ST163, the faceclustering unit 106 pops one of nodes included in the stack in stepST164.

In step ST165, the face clustering unit 106 determines whether thepopped node has been over-merged. When the determination is affirmativein step ST165, the face clustering unit 106 proceeds to step ST166, andpushes nodes in a layer immediately lower than the current node into thestack. Thereafter, the face clustering unit 106 returns to step ST163,and performs the processing described above again. On the other hand,when the determination is negative in step ST165, the face clusteringunit 106 proceeds to step ST167 where the face clustering unit 106determines the current node to be the final cluster and stores thecurrent node in a cluster list. Thereafter, the face clustering unit 106returns to step ST163, and performs the processing described aboveagain.

When the determination is affirmative in step ST163, the face clusteringunit 106 directly proceeds to step ST168 where the processing isterminated.

The cluster over-merging determination processing performed in stepST165 will be described in detail. FIG. 39 is a flowchart illustrating aprocedure of the cluster over-merging determination processing performedby the face clustering unit 106. In step ST171, the face clustering unit106 starts processing, and proceeds to step ST172. In step ST172, foreach of the nodes, in accordance with a leaf list of a node of interest,the face clustering unit 106 obtains an average face feature value offace images in which the face IDs thereof are included in the leaf listof the node of interest. Therefore, the face clustering unit 106corresponds to an average-feature-value calculation unit.

In this embodiment, the face feature values correspond to thelocal-feature-value vectors calculated by the face-feature-valuecalculation unit 103 (refer to Expression (12)). Therefore, when N faceIDs are included in the leaf list, the face clustering unit 106 adds thelocal-feature-value vectors corresponding to the N face images forindividual elements included in the local-feature-value vectors andobtains averages of the individual elements whereby the averagelocal-feature-value vector is obtained in step ST172 as shown in FIG.40.

In step ST173, the face clustering unit 106 obtains a face feature valueof a first face image included in the node of interest. In step ST174,the face clustering unit 106 calculates individual-similarity-degreewhich is a degree of similarity between the average face feature valueobtained in step ST172 and the face feature value obtained in stepST173. Furthermore, in step ST174, the face clustering unit 106 obtainsan average similarity degree which is an average value of the currentlyobtained individual-similarity-degree and a previously obtainedindividual-similarity-degree.

In step ST175, the face clustering unit 106 determines whether theindividual-similarity-degree obtained in step ST174 is larger than athreshold value for a comparison with the individual-similarity-degree.It is assumed that the average feature value obtained in step ST172 isrepresented by f_(average), the face feature value obtained in stepST173 is f_(i), the individual-similarity-degree obtained in step S174is represented by Similarity(f_(i), f_(average)), and the thresholdvalue for a comparison with the individual-similarity-degree isrepresented by Threshold2.

In this case, in step ST175, the face clustering unit 106 determineswhether Similarity(f_(i), f_(average)) is larger than Threshold2. Notethat “i” of “f_(i)” represents that this face feature value is for thei-th face image in the node.

When the determination is affirmative in step ST175, the face clusteringunit 106 proceeds to step ST176 and determines whether all the faceimages have been processed. When the determination is negative in stepST176, the face clustering unit 106 proceeds to step S177, and obtains aface feature value of the next face image in the node. Thereafter, theface clustering unit 106 returns to step ST174, and performs theprocessing described above again.

On the other hand, when the determination is affirmative in step ST176,the face clustering unit 106 proceeds to step ST178. In step S178, theface clustering unit 106 determines whether the average similaritydegree ultimately obtained in step ST174 is larger than a thresholdvalue for a comparison with the average similarity degree.

It is assumed that the average similarity value ultimately obtained instep ST172 is represented by Average(Similarity(f_(i), f_(average))) andthe threshold value for a comparison with the average similarity degreeis represented by Threshold1. In this case, the face clustering unit 106determines whether Average(Similarity(f_(i), f_(average)) is larger thanThreshold1 in step ST178.

When the determination is affirmative in step ST178, the face clusteringunit 106 proceeds to step ST179, and determines that the node ofinterest (popped node) is not an over-merged node. Thereafter, theprocessing is terminated in step ST180.

When the determination is negative in step ST175 or step ST178, the faceclustering unit 106 determines that the node of interest (popped node)is an over-merged node in step ST181. Thereafter, the processing isterminated in step ST180.

The threshold value Threshold2 for a comparison with theindividual-similarity-degree and the threshold value Threshold1 for acomparison with the average similarity degree used in step ST175 andstep ST178, respectively, in the cluster over-merging determinationprocessing shown in FIG. 39 are clustering setting parameters. Althoughnot mentioned above, the face clustering unit 106 is connected to a usersetting unit 107 (refer to FIG. 1). The user arbitrarily sets thethreshold value Threshold2 for a comparison with theindividual-similarity-degree and the threshold value Threshold1 for acomparison with the average similarity degree using the user settingunit 107.

FIG. 41 is a diagram illustrating an example of the determination ofclusters in the cluster determination processing shown in the flowchartof FIG. 38. In this example of the cluster determination, nodescorresponding to node numbers 25, 19, 4, 20, 13, and 23 are stored inthe cluster list as final clusters.

Referring back to the flowchart of FIG. 29, the face clustering unit 106performs representative-face determination processing in step ST135. Inthis case, the face clustering unit 106 determines a representative faceimage among a plurality of face images included in each of clustersobtained as results of the clustering processing. Therefore, the faceclustering unit 106 corresponds to a representative-face determinationunit. The face clustering unit 106 determines, for each of the clusterswhich includes the plurality of face images, a representative face imageon the basis of face-rotation-angle information items (roll, pitch, andyaw), smile scores, and contrast scores of the plurality of face images.

FIG. 42 is a flowchart illustrating a procedure of therepresentative-face determination processing performed by the faceclustering unit 106. The face clustering unit 106 starts the processingin step ST191, and proceeds to step ST192. In step ST192, the faceclustering unit 106 calculates angle scores S_(front) of a plurality offace images included in a cluster of interest. The angle scoresS_(front) of the face images are calculated using roll angles, pitchangles, and yaw angles which are face-rotation angle information itemsof the face images in a still-image frame of interest in accordance withExpression (30). In Expression (30), coefficients a, b, and c correspondto weighting coefficients for individual angles.

S _(front) =a|roll|+b|pitch|+c|yaw|  (30)

In step ST192, the face clustering unit 106 sorts the face images in anascending order of the angle scores S_(front) of the face imagescalculated as described above. Note that as the angle scores S_(front)of the face images are small, directions of faces corresponding to theface images are closer to the front. In step ST193, the face clusteringunit 106 reduces the number of face images so as to obtain a firstface-image group including face images having angle scores smaller thana front-face-determination threshold value.

In step ST194, the face clustering unit 106 sorts the face imagesincluded in the first face-image group in a descending order of thesmile scores. In step ST195, the face clustering unit 106 reduces thenumber of face images so as to obtain a second face-image groupincluding face images having smile scores larger than a smile thresholdvalue.

In step ST196, the face clustering unit 106 sorts the face imagesincluded in the second face-image group in a descending order of thecontrast scores. In step ST197, the face clustering unit 106 determinesthat, among the face images included in the second face-image group, aface image having the largest contrast score to be a representative faceimage. After step ST197, the face clustering unit 106 proceeds to stepST198 where the processing is terminated.

By performing the representative-face determination processing shown inthe flowchart of FIG. 42, the face clustering unit 106 determines, amongthe plurality of face images included in the cluster of interest, a faceimage in which a direction of a face corresponding to the face image iscloser to the front and which has a high smile score and a high contrastscore to be a representative face image. It is assumed that four faceimages, i.e., a face image which does not correspond to a front face, aface image which corresponds to a front face and which has a uniformluminance, a face image which corresponds to the front face and whichhas nonuniform luminance, and a face image which corresponds to thefront face and which is a blurred face image, as shown in FIGS. 43A to43D, respectively, are included in a cluster. In this case, the faceimage which corresponding to the front face and which has the uniformluminance is determined to be a representative face image.

Note that the front-face-determination threshold value and the smilethreshold value used in step ST193 and step ST195, respectively, in therepresentative-face determination processing shown in the flowchart ofFIG. 42 are clustering setting parameters. The user arbitrarily sets thefront-face-determination threshold value and the smile threshold valueusing the user setting unit 107 (refer to FIG. 1).

Although all the face-rotation-angle information items, the smilescores, and the contrast scores are used in the representative-facedetermination processing shown in the flowchart of FIG. 42, all of themare not necessarily used for the representative-face determinationprocessing. That is, only some of them may be used for therepresentative-face determination processing. Furthermore, although aface image having a high degree of smile is determined to be arepresentative face image using the smile scores, a face image having ahigh degree of other facial expression may be determined to be therepresentative face image. In this case, scores of other facialexpression are calculated instead of the smile scores using theface-feature-value calculation unit 103, and the obtained scores areused for the representative-face determination processing.

The face clustering unit 106 outputs data items regarding the clustersdetermined to be the final clusters in the cluster determinationprocessing. The data items regarding the clusters represent characterdata items which are used to display the characters in the moving-imagestream with less overlaps of character data items representing anidentical person.

Referring back to the flowchart of FIG. 29, after step ST135, the faceclustering unit 106 proceeds to step ST136 where the processing isterminated.

Accuracy-Evaluation Algorithm of Face Clustering

An accuracy-evaluation algorithm of the face clustering processing willbe described. The threshold value Threshold2 for a comparison with theindividual-similarity-degree and the threshold value Threshold1 for acomparison with the average similarity degree used in the clusterover-merging determination processing performed by the face clusteringunit 106 are determined in accordance with the accuracy-evaluationalgorithm of the face clustering processing.

FIG. 44 is a diagram illustrating an example of a result obtained whenthe face clustering processing is performed on a plurality of faceimages representing persons “Mr. A” to “Mr. K”. In this case, it ispossible that a cluster of a predetermined person includes face imagesof other persons. For example, as shown in the example of the result ofFIG. 44, a cluster of “Mr. A” includes face images “Mr. B”, “Mr. C”, and“Mr. D”. A state in which face images representing different persons aremistakenly determined to be face images representing an identical personmeans over-merging. Furthermore, in the example of the result, inaddition to a cluster of “Mr. B”, clusters of “Mr. A” and “Mr. K”include face images of “Mr. B”. A state in which face imagesrepresenting an identical person are mistakenly determined to be faceimages of different persons means over-dividing.

FIG. 45 is a confusion table representing the relationships betweenpredicting results and actual results. In this confusion table, c(i, j)denotes the number of face images of a person j included in a cluster ofa person i. FIG. 46 is a confusion table obtained when ideal faceclustering processing is performed. In this case, when j is not equal toi, c(i, j) is 0. That is, the number of face images of the person jincluded in the cluster of the person i is 0.

Thinking about entropy (average information value), when face images ofpersons A and B are accurately classified into clusters A and B,respectively, as shown in FIG. 47, an entropy H(X) is 0. However, whenthe face images of the persons A and B are classified so that each ofthe clusters A and B includes some of the face images of the otherperson as shown in FIG. 48, the entropy H(X) is larger than 0.Furthermore, when the face images of the persons A and B are classifiedso that each of the clusters A and B includes half the face images ofthe other person as shown in FIG. 49, which is a worst classification,the entropy H(X) is 1.

In the accuracy-evaluation algorism of the face clustering, acombination of two different concepts, that is, the confusion table(refer to FIG. 45) and the entropy, are used so that an over-mergingscore SCRc and an over-dividing score SCRd are obtained.

That is, the over-merging score SCRc is obtained by obtaining entropiesEntropy(row(n)) of individual rows, weighting each of the entropiesEntropy(row(n)) by the number of face images of a corresponding one ofthe rows, and adding the entropies Entropy(row(n)) to one another. Theover-dividing score SCRd is obtained by obtaining entropiesEntropy(column(m)) of individual columns, weighting each of theentropies Entropy(column(m)) by the number of face images of acorresponding one of the rows, and adding the entropiesEntropy(column(m)) to one another. Note that the entropies Entropy(row(n)) and the entropies Entropy (column(m)) are weighted by thenumber of face images so that as the number of face images included ineach of the rows is larger, the rows considerably affects the entropies.

Expression (31) represents the entropies Entropy(row(n)) and Expression(32) represents the over-merging score SCRc. Expression (33) representsthe entropies Entropy(column(m)) and Expression (34) represents theover-merging score SCRd.

$\begin{matrix}{{{Entropy}\left( {{row}(n)} \right)} = {- {\sum\limits_{i = 1}^{N}{{q\left( {n,i} \right)}{\log_{\sum\limits_{i = 1}^{N}{c{({n,i})}}}\left( {q\left( {n,i} \right)} \right)}}}}} & (31) \\{{SCRc} = {\sum\limits_{i = 1}^{M}\left\{ {{p(i)}{{Entropy}\left( {{row}(i)} \right)}} \right\}}} & (32) \\{{{Entropy}\left( {{colum}(m)} \right)} = {- {\sum\limits_{i = 1}^{M}{{p\left( {i,m} \right)}{\log_{M}\left( {q\left( {i,m} \right)} \right)}}}}} & (33) \\{{SCRd} = {\sum\limits_{i = 1}^{N}\left\{ {{q(i)}{{Entropy}\left( {{colum}(i)} \right)}} \right\}}} & (34)\end{matrix}$

Furthermore, p(n, m), q(n, m), p(n), and q(m) are obtained byExpressions (35), (36), (37), and (38), respectively.

$\begin{matrix}{{p\left( {n,m} \right)} = \frac{c\left( {n,m} \right)}{\sum\limits_{i = 1}^{M}{c\left( {i,m} \right)}}} & (35) \\{{q\left( {n,m} \right)} = \frac{c\left( {n,m} \right)}{\sum\limits_{i = 1}^{N}{c\left( {n,i} \right)}}} & (36) \\{{p(n)} = \frac{\sum\limits_{i = 1}^{N}{c\left( {n,i} \right)}}{\sum\limits_{i = 1}^{N}{\sum\limits_{j = 1}^{M}{c\left( {i,j} \right)}}}} & (37) \\{{q(m)} = \frac{\sum\limits_{i = 1}^{M}{c\left( {i,m} \right)}}{\sum\limits_{i = 1}^{N}{\sum\limits_{j = 1}^{M}{c\left( {i,i} \right)}}}} & (38)\end{matrix}$

As the threshold value Threshold2 for a comparison with theindividual-similarity-degree and the threshold value Threshold1 for acomparison with the average similarity degree used in the clusterover-merging determination processing performed by the face clusteringunit 106, values which make the over-merging score SCRc and theover-dividing score SCRd close to 0 are obtained in advance.

As described above, in the image processing apparatus 100 shown in FIG.1, the identical-faces-merging processor 105 determines whether a personin a face image detected in a current frame is identical to a person ina face image detected in a previous frame which has been stored, inaccordance with face feature values of the two face images. When thedetermination is affirmative, only one of the two face images is stored.Therefore, a still-image frame from which face images are detected bythe decoding unit 101 is extracted substantially every seconds, forexample. Accordingly, since the number of frames to be analyzed issmall, extraction of characters with short analysis time is achieved. Ina case where a moving-image stream corresponds to a MPEG stream or anAVC stream, for example, only intraframes included in the stream atpredetermined intervals are decoded to be used, that is, full decodingis not performed. Consequently, the analysis time is considerablyreduced.

Furthermore, in the image processing apparatus 100 shown in FIG. 1, theidentical-faces-merging processor 105 determines whether the person inthe current face image and the person in the previous face image areidentical to each other in accordance with detection-frame informationitems of the two face images and an interval between frames of the twoface images, in addition to the face feature values of the two faceimages. Accordingly, accuracy of the determination is improved. It isassumed that a degree of similarity of the two face images which isobtained using the face feature values of the two face images is low dueto change of a lighting condition, for example, even though the two faceimages represent an identical person. In this case, it is determinedthat the two face images represent an identical person by determiningwhether the detection-frame information items of the two face images andthe interval between frames of the two face images satisfy predeterminedconditions.

Furthermore, in the image processing apparatus 100 shown in FIG. 1, thenoise-face removing unit 104 removes a face image which is determinedthat a predetermined angle with respective to the front, i.e., a yawangle or a pitch angle thereof, for example, is larger than a thresholdvalue. Therefore, face images representing a face which facesconsiderably sideways, a face which faces considerably upward, and aface which faces considerably downward are removed. Accordingly,determination accuracies of the identical-faces-merging processor 105and the face clustering unit 106 are prevented from being deteriorated.

Moreover, in the image processing apparatus 100 shown in FIG. 1, thenoise-face removing unit 104 removes a face image which has a contrastscore which is calculated by the face-feature-value calculation unit 103and which is smaller than a threshold value. Therefore, face imageswhich have considerably low contrast and which are blurred face imagesare removed in advance. Accordingly, determination accuracies of theidentical-faces-merging processor 105 and the face clustering unit 106are prevented from being deteriorated.

In the image processing apparatus 100 shown in FIG. 1, the faceclustering unit 106 is arranged in a succeeding stage relative to theidentical-faces-merging processor 105. Therefore, the face clusteringunit 106 classifies face images in the moving-image stream stored in theidentical-faces-merging processor 105 so that face images representingidentical persons are assigned to a single cluster. Accordingly,character data is effectively obtained.

In the image processing apparatus 100 shown in FIG. 1, when determiningthat the face image detected in the current frame and the face imagedetected in the previous frame represent an identical person, theidentical-faces-merging processor 105 stores only one of the two faceimages. Accordingly, when the end of the moving-image stream is reached,the number of face images ultimately stored in theidentical-faces-merging processor 105 is reduced. Consequently, a periodof time used for the processing performed by the face clustering unit106 is reduced.

In the image processing apparatus 100 shown in FIG. 1, the faceclustering unit 106 successively performs the similarity matrixcalculation, the layering/clustering processing, and the clusterdetermination processing. Accordingly, clustering in which face imagesof an identical person are assigned to a single cluster is effectivelyperformed.

In the image processing apparatus 100 shown in FIG. 1, the faceclustering unit 106 performs the clustering processing in which, amongthe face images stored by the identical-faces-merging processor 105,face images of an identical person are assigned to a single cluster, anddetermines a representative face image for the cluster including theface images. Therefore, in a browser application which displays the faceimages of the characters in the moving-image stream, overlap of faceimages of an identical person is prevented, and furthermore, optimumface images are displayed.

Note that, in the image processing apparatus 100 shown in FIG. 1, allthe face images ultimately stored by the identical-faces-mergingprocessor 105 are subjected to the face clustering processing performedby the face clustering unit 106. However, the face clustering unit 106first performs the similarity matrix calculation as described above.Therefore, when the number of the face images (character candidates)ultimately stored by the identical-faces-merging processor 105 is toolarge, the number of face images to be input to the face clustering unit106 may be restricted. For example, the maximum number of face imagesmay be determined to be 100 after the priority of the face images to beinput is determined by sorting the face images in accordance with sizesof the detection frames, the smile scores, or the contrast scores.

In the image processing apparatus 100 of FIG. 1, the noise-face removingunit 104 is arranged in a preceding stage relative to theidentical-faces-merging processor 105. However, the noise-face removingunit 104 may be eliminated.

In the image processing apparatus 100 of FIG. 1, the moving-image filerecorded in the hard disk (HDD) or the memory card is read, for example,and the characters are extracted from the moving-image stream includedin the moving-image file. However, this invention is applicable to acase where characters are extracted from a moving-image stream obtainedwhile a moving image is captured using a moving-image capturingapparatus, such as a digital camera recorder (camcoder) or a digitalstill camera.

In the image processing apparatus 100 shown in FIG. 1, face images aredetected from a still-image frame. Similarly, this invention isgenerally applicable to a case where an image of a specific object isdetected.

In the this embodiment, the decoding unit 101 decodes only intra frames(I-Frames). However, the decoding unit 101 may decodes all framesincluded in a moving-image stream such as an MPEG video signal in asystem which allows analysis which takes long time, such as a digitalarchive system, and may supply the decoded frames to the face detectionunit 102, in a succeeding stage for example, to be processed. In thiscase, when compared with the processing only using the intraframes, aspeed of analysis is lowered. However, misses of detections ofcharacters are reduced.

Note that the functional units of the image processing apparatus 100 inthis embodiment are realized by hardware or software. When thefunctional units are realized by software, a computer executesprocessing of each of the functional units in accordance with a programstored in a ROM (Read Only Memory) or a hard disk.

FIG. 50 is a diagram illustrating an example of an inner configurationof a computer 500 which executes processing operations of the functionalunits. A CPU (Central Processing Unit) 501 executes various operationsin accordance with programs stored in a ROM 502. A RAM (Random AccessMemory) 503 appropriately stores data and programs used when the CPU 501performs various operations.

An input/output interface 505, the CPU 501, the ROM 502, and the RAM 503are connected to a bus 504. An input unit 506 including a keyboard and amouse is connected to the input/output interface 505. The input/outputinterface 505 outputs signals input from the input unit 506 to the CPU501. Furthermore, an output unit 507 including a display and a speakeris also connected to the input/output interface 505.

Moreover, a storage unit 508 including a hard disk and a communicationunit 509 which communicates with other apparatuses through a networksuch as the Internet are also connected to the input/output interface505. A drive 510 is also connected to the input/output interface 505 andis used to read data from or write data to a recording medium such as amagnetic disk, an optical disc, a magneto-optical disc, or asemiconductor memory. A moving-image file to be processed is input fromthe communication nit 509 or the drive 510 and stored in the storageunit 508, such as a hard disk.

The present application contains subject matter related to thatdisclosed in Japanese Priority Patent Application JP 2008-159782 filedin the Japan Patent Office on Jun. 18, 2008, the entire content of whichis hereby incorporated by reference.

It should be understood by those skilled in the art that variousmodifications, combinations, sub-combinations and alterations may occurdepending on design requirements and other factors insofar as they arewithin the scope of the appended claims or the equivalents thereof.

1. An image processing apparatus comprising: a face detector configuredto detect face images included in still-image frames successivelyextracted from a moving-image stream in accordance with imageinformation items regarding the still-image frames; a face-feature-valuecalculation unit configured to calculate face feature values of the faceimages in accordance with image information items regarding the faceimages detected by the face detector; an identity determination unitconfigured to determine whether a first face image which is included ina current frame and which is detected by the face detector and a secondface image which is included in a previous frame and which has beendetected and stored by the face detector represent an identical personin accordance with at least face feature values of the first and secondface images calculated by the face-feature-value calculation unit; and amerging processor configured to store only one of the first and secondface images when the identity determination unit determined that thefirst face image and the second face image represent an identicalperson, and to store both the first and second face images when theidentity determination unit determined that the first face image and thesecond face image do not represent an identical person.
 2. The imageprocessing apparatus according to claim 1, further comprising: adecoding unit configured to successively extract the image informationitems regarding the still-image frames by performing data decompressionprocessing on image information items of intraframes which are includedin the moving-image stream at predetermined intervals.
 3. The imageprocessing apparatus according to claim 1, wherein the identitydetermination unit obtains a degree of similarity between the first andsecond face images in accordance with the face feature values of thefirst and second face images, and compares the degree of similarity witha threshold value so as to determine whether the first and the secondface images represent an identical person.
 4. The image processingapparatus according to claim 1, wherein the identity determination unitdetermines whether the first and second face images represent anidentical person in accordance with, in addition to the face featurevalues of the first and second face images, at least detection-frameinformation items regarding the first and second face images orinformation on an interval between frames of the first and second faceimages.
 5. The image processing apparatus according to claim 4, whereinthe identity determination unit obtains a degree of similarity betweenthe first and second face images in accordance with the face featurevalues of the first and second face images, determines that the firstand second face images represent an identical person when the degree ofsimilarity is equal to or larger than a first threshold value, anddetermines that the first and second face images represent an identicalperson when the detection-frame information items regarding the firstand second face images and the information on an interval between framesof the first and second face images satisfy predetermined conditions andwhen the degree of similarity is smaller than the first threshold valueand equal to or larger than a second threshold value.
 6. The imageprocessing apparatus according to claim 5, wherein the predeterminedcondition for the detection-frame information items includes a firstcondition in which a distance between a center of a detection frame ofthe first face image and a center of a detection frame of the secondface image is smaller than a threshold value, and a second condition inwhich an ratio of an area of the detection frame of the first face imageto an area of the detection frame of the second face image is in a rangefrom a first threshold value to a second threshold value, and thepredetermined condition for the information on a frame intervalcorresponds to a condition in which an interval between frames of thefirst and second face images are smaller than a threshold value.
 7. Theimage processing apparatus according to claim 1, further comprising: aface-rotation-angle detector configured to detect face-rotation anglesrepresenting angles of faces represented by the face images detected bythe face detector; and a noise-face removing unit configured to remove,from among all the face images detected by the face detector, faceimages having face-rotation angles in a predetermined direction relativeto the front which are larger than a threshold value, in accordance withinformation items regarding the face-rotation angles detected by theface-rotation-angle detector.
 8. The image processing apparatusaccording to claim 1, further comprising: a contrast score calculationunit configured to calculate contrast scores representing contrast ofthe face images in accordance with the image information items regardingthe face images detected by the face detector; and a noise-face removingunit configured to remove face images having contrast scores, which havebeen calculated by the contrast score calculation unit, smaller than athreshold value from among all the face images detected by the facedetector.
 9. The image processing apparatus according to claim 1,further comprising: a face clustering unit configured to assign the faceimages stored by the merging processor to clusters at least inaccordance with the face feature values calculated by theface-feature-value calculation unit so that face images representing anidentical person are assigned to a single cluster.
 10. The imageprocessing apparatus according to claim 9, wherein the face clusteringunit includes a similarity degree calculation unit configured tocalculate degrees of similarity of individual pairs of face imagesextracted from the face images stored by the merging processor inaccordance with the face feature values of the pairs of face images, alayering-and-clustering unit configured to assign the face images storedby the merging processor to individual clusters, and successively mergeclusters including each of the pairs of face images in accordance withthe degrees of similarity of the pairs of face images calculated by thesimilarity degree calculation unit in a descending order of the degreesof similarity of the pairs of face images, and a cluster determinationunit configured to determine whether over-merging occurred on theclusters starting from a cluster at an uppermost layer in accordancewith cluster information items arranged in a tree-shaped structureobtained by the layering-and-clustering unit, and determine clusters bydividing each of clusters which have been determined to be over-mergedclusters into two clusters which were obtained before merging processingis performed by the layering-and-clustering unit.
 11. The imageprocessing apparatus according to claim 10, wherein the clusterdetermination unit includes an average-face-feature-value calculationunit configured to calculate an average face feature value, which isobtained by averaging the face feature values of the face imagesincluded in a cluster subjected to the over-merging determinationprocessing, and an individual-similarity-degree calculation unitconfigured to calculate an individual-similarity-degree in accordancewith the average face feature value calculated by theaverage-face-feature-value calculation unit and a face feature value ofone of the face images included in the cluster subjected to theover-merging determination processing, and when theindividual-similarity-degree for at least one of the face imagesincluded in the cluster subjected to the over-merging determinationprocessing is smaller than a threshold value for a comparison with aindividual-similarity-degree, it is determined that the clustersubjected to the over-merging determination processing is an over-mergedcluster.
 12. The image processing apparatus according to claim 11,further comprising: a user setting unit configured to allow a user toset the threshold value for a comparison with aindividual-similarity-degree.
 13. The image processing apparatusaccording to claim 11, wherein the cluster determination unit furtherincludes an average-similarity-degree calculation unit configured tocalculate an average similarity degree by averagingindividual-similarity-degrees for the face images included in thecluster subjected to the over-merging determination processing, theindividual-similarity-degrees being obtained by theindividual-similarity-degree calculation unit, and when the averagesimilarity degree calculated by the average-similarity-degreecalculation unit is smaller than a threshold value for a comparison withan average similarity degree, it is determined that the clustersubjected to the over-merging determination processing is an over-mergedcluster.
 14. The image processing apparatus according to claim 13,further comprising: a user setting unit configured to allow a user toset the threshold value for a comparison with an average similaritydegree.
 15. The image processing apparatus according to claim 9, furthercomprising: a representative-image determination unit configured todetermine, for each of clusters including a plurality of face images, arepresentative face image from among the plurality of face imagesincluded in each of the clusters.
 16. The image processing apparatusaccording to claim 15, wherein the representative-image determinationunit determines, for each of the clusters including the plurality offace images, the representative face image from among the plurality offace images included in each of the clusters in accordance with at leastface-rotation-angle information items, facial-expression informationitems, or contrast information items regarding the plurality of faceimages.
 17. The image processing apparatus according to claim 16,wherein, for each of the clusters including the plurality of faceimages, the representative-image determination unit reduces the numberof the face images in accordance with the face-rotation-angleinformation items so as to obtain a first face-image group includingface images having face-rotation angles smaller than a first thresholdvalue, reduces the number of the face images included in the firstface-image group in accordance with the facial expression informationitems so as to obtain a second face-image group including face imageshaving scores representing degrees of a specific facial expressionlarger than a second threshold value, and determines, from among theface images included in the second face-image group, a face image havingthe highest score representing a degree of contrast to be therepresentative face image in accordance with the contrast informationitems.
 18. The image processing apparatus according to claim 17, furthercomprising: a user setting unit configured to allow a user to set thefirst and second threshold values.
 19. An image processing methodcomprising the steps of: detecting face images included in still-imageframes successively extracted from a moving-image stream in accordancewith image information items regarding the still-image frames;calculating face feature values of the face images in accordance withimage information items regarding the detected face images; determiningwhether a detected first face image included in a current frame and adetected second face image which is included in a previous frame andwhich has been stored represent an identical person in accordance withat least calculated face feature values of the first and second faceimages; and storing only one of the first and second face images when itis determined that the first face image and the second face imagerepresent an identical person, and storing both the first and secondface images when it is determined that the first face image and thesecond face image do not represent an identical person.
 20. A programwhich causes a computer to execute: detecting face images included instill-image frames successively extracted from a moving-image stream inaccordance with image information items regarding the still-imageframes; calculating face feature values of the face images in accordancewith image information items regarding the detected face images;determining whether a detected first face image included in a currentframe and a detected second face image which is included in a previousframe and which has been stored represent an identical person inaccordance with at least calculated face feature values of the first andsecond face images; and storing only one of the first and second faceimages when it is determined that the first face image and the secondface image represent an identical person, and storing both the first andsecond face images when it is determined that the first face image andthe second face image do not represent an identical person.